Undated (AP) _ A last minute rush by procrastinating Christmas shoppers turned slumping retail sales around and gave storeowners a profitable December.

Figures released today by the retailers credited a surge in sales in the final days before the holiday with turning their performance around. The figures are from large stores selling general merchandise, including apparel and specialty retailers and department stores.

K mart Corp., which had reported relatively slow sales in the first three weeks of December, said a jump in buying just before Christmas gave the company an 8.7 percent increase in sales. K mart reported sales of $3.9 billion for the five weeks ending Dec. 31, against sales of $3.59 billion in the comparable period a year earlier.

Wal-Mart stores, which was among the retailers reporting strong pre- Christmas sales, said it had a 36 percent increase in the month of December, with sales of $1.69 billion, compared with $1.24 billion in 1985.

Sears, Roebuck and Co., which had said its pre-Christmas sales were reasonably good, reported sales up by 4.8 percent for the five weeks ending Jan. 3. Sears said it had sales of $3.92 billion, up from $3.74 billion in the same period a year ago.

Jeffrey Feiner, a retail industry analyst with Merrill Lynch & Co., said the stores were ''aided by a strong last minute rush to the stores.''

Retailers did not have to mark merchandise down significantly, Feiner said, and their profits for the period were relatively favorable.

''We believe that general merchandise sales will have increased by about 6.5 to 7 percent during the Christmas selling period, while retail industry profits increased an estimated 10 percent,'' he said.

Analysts said retailers, hurt by a slump in 1984, had protected themselves against the possibility of slower sales by cutting back their inventories.

Here are results of other retailers reported early today:

- J.C. Penney Co., Inc. said it had a 1.4 percent increase in sales for the five weeks ending Jan. 3. J.C. Penney said its sales totaled $2.32 billion, up from $2.29 billion a year earlier.

- May Department Stores Co. reported sales of $1.81 billion for the five- week period ending Jan. 3. That was up 10.2 percent over sales of $1.64 billion a year earlier.

- Montgomery Ward & Co. said its sales increased by 7.8 percent for the five-week period ending Jan. 3. The company said it had sales of $706 million, compared with $655 million a year ago.