J.C. Penney swung to a small profit in the fourth quarter from a massive loss a year ago. The improved results come even as the beleaguered retailer had a revenue shortfall.

The company also said that it expects that a key revenue measure should increase from 3 percent to 5 percent in the current quarter, which would mark the second straight quarter of gains in more than two years.

Investors were encouraged by the results, pushing shares up nearly 5 percent, or 29 cents, to $6.25 per share in aftermarket trading when the results were announced. Shares had risen close to 6 percent, or 33 cents per share, to $5.96 during regular trading.

The results, which cover the crucial holiday shopping season, show signs that Penney is making strides in recovering from a botched transformation plan by its former CEO, Ron Johnson. Johnson, the mastermind behind Apple's retail concept, was ousted last April after 17 months on the job, and the board rehired Mike Ullman who had previously been at the helm for seven years.

Ullman is trying to win back shoppers by restoring the sales events and basic merchandise that the company ditched under Johnson in a bid to attract younger, wealthier consumers. Earlier last month, Penney announced thousands of jobs cuts and the closure of 33 stores as it attempts to get back on the path of profitability.

"J.C. Penney achieved what it set out to do on a number of important fronts in 2013," said Ullman, in a statement. "We stabilized our business, both financially and operationally."

But he acknowledged there's more work to do.

Shares are down 86 percent from the $43 it reached in early February 2012 when investor enthusiasm was high amid hopes for Johnson's plan. The stock is down 32 percent so far this year.

Penney said Wednesday that it earned $35 million, or 11 cents per share, in the three-month period ended Feb. 1. That compares with a massive loss of $552 million, or $2.51 per share, in the year-ago period.

Revenue slipped 2.6 percent to $3.78 billion.

Excluding a tax benefit and other items, Penney had a loss of $206 million, or 68 cents per share, in the quarter. Analysts had expected a loss of 81 cents on revenue of $3.84 billion.

The company said revenue at stores opened at least a year was up 2 percent in the fourth quarter. That's compared with a 31.7 percent plunge for that measure for the holiday quarter a year ago.

In the latest year, Penney recorded a loss of $1.39 billion or $5.57 per share, while revenue dropped 8.7 percent to $11.86 billion as Johnson's legacy continues to cast a shadow on its results.

Penney recorded a nearly $1 billion loss as revenue dropped 25 percent to $12.9 billion for the year that ended Feb. 2, 2013, the company's first year of Johnson's failed transformation plan.

Last month, the company said that it ended 2013 with more than $2 billion in total available liquidity.