Plano, Texas — J.C. Penney delivered some encouraging news in the form of rising comparable-stores Friday, reversing four straight quarters of declines and it posted smaller-than-expected loss for the third quarter.

Shares soared 15 percent before the opening bell.

The news staunched, at least for a moment, an extended sell-off in company shares, which accelerated last month when J.C. Penney warned that it would be forced to liquidate poor-selling merchandise. Shares which have tumbled 67 percent this year, hit an all-time low.

Initiatives to spiff up clothing lines to fuel sales is, “giving us confidence that our overall strategy and transformation is beginning to take hold,” said CEO Marvin Ellison in a company release Friday.

Yet more challenges lie ahead with the critical holiday shopping season approaching.

J.C. Penney, like other department stores, has struggled to follow shoppers who have migrated online or who are now going to off-price retailers like T.J. Maxx.

Sales have stabilized since a disastrous attempt to reinvent the company under former Apple executive Ron Johnson. The company has since attempted to lure customers back by returning to its sales floor major appliances like dishwashers. It’s also been expanding its in-store Sephora beauty shops.

J.C. Penney Co. reported a loss of $128 million, or 41 cents, for the quarter. That compares with a loss of $67 million, or 22 cents per share in the year-ago quarter.

Losses, adjusted for one-time gains and costs, came to 33 cents per share, or a dime better than analysts polled by Zacks Investment Research had expected.

Revenue at stores opened at least a year rose 1.7 percent, when industry analyst had been projecting another decline.

Last month, the company said that it expected a per-share loss of between 40 and 45 cents for the quarter. It also projected per-share profits of between 2 and 8 cents for the year, way down from an earlier outlook of between 40 cents to 65 cents.

The retailer on Friday stuck to those annual outlooks.

Shares rose 40 cents to $3.17 in premarket trading. A year ago, shares were trading at $8.36.