NEW YORK - J.C. Penney said a key sales figure rose in its first quarter, offering an encouraging sign for the beleaguered department store operator.

The company, which is based in Plano, Texas, said sales at stores open at least a year rose 6.2 percent in the period, marking the second straight quarterly gain. A year ago, the figure had dropped 16.6 percent.

Its stock surged more than 20 percent to $10.08 in aftermarket trading.

Penney has been trying to recover from a botched transformation plan by former CEO Ron Johnson that resulted in massive losses and plunging sales. Johnson, the mastermind behind Apple's retail concept, was ousted in April of last year 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 sales events and basic merchandise that the company ditched under Johnson's tenure in a bid to attract affluent, younger consumers. That means discontinuing some of the new trendy brands like William Rast and Joe by Joseph Abboud that were brought in by Johnson but weren't resonating with Penney's middle-income shoppers.

Ullman is also revamping the home area, after Johnson's plan to overhaul the section with too many trendy and pricy items didn't sit well with customers. The home area is a key driver of customer traffic.

"It is clear that our efforts to re-merchandise many areas of the store and revamp our messaging to the customer are taking hold," Ullman said in a statement Thursday.

Looking ahead, J.C. Penney said it expect sales at established stores to rise in the mid-single digits and gross margin to improve significantly from last year.

But the company's results still show that it needs to increase how much profit it makes on each item and do more to bring back customers.

For the period ended May 3, the company said it lost $352 million, or $1.15 per share, which was better than the loss of $1.25 per share analysts expected. A year ago, the lost $1.58 per share.

Revenue rose to $2.8 billion, above the $2.71 billion analysts expected.