J.C. Penney jcp gave investors a rare good surprise on Friday when it reported better than expected third-quarter sales, sending shares up 14% in pre-market trading.
The department store, which only two weeks ago saw shares hit an all-time low after it slashed its 2017 profit forecast, said that comparable sales rose 1.7% in the quarter ended Oct. 28. It had said in late October, near the end of the quarter, that the metric, which eliminates the impact of newly opened or closed stores (it has closed 139 stores this year), would rise 0.6% to 0.8%.
It’s not clear why Penney underestimated its own sales by that much when there was only one day left in the quarter.
More from FORTUNE
Penney, which has had to aggressively discount much of women’s apparel to clear it out, said the move was necessary to make room for improved merchandise coming into the crucial holiday season. It was the second quarter of comparable sales growth in a row for Penney, which had seen its business slip last holiday season and in the first part of this year.
The retailer has been trying to reduce its reliance on apparel, a declining category across retail, by shifting much of its business to large items like appliances—whose sales doubled in the quarter compared to a year earlier, CEO Marvin Ellison said on an investor call—and services like home installations.
Ellison said in a statement the results give him “confidence that our overall strategy and transformation is beginning to take hold.”
Still, those markdowns were painful: Penney’s net loss nearly doubled to $128 million from $67 million a year earlier, due to the clearance as well as other factors such as store closing costs. Total net sales fell 1.8% to $2.81 billion from $2.86 billion a year ago.
Penney is not the only department store to show signs of improvement: Kohl’s kss on Thursday reported its comparable sales rose 0.1% last quarter, an improvement over recent declines, while Macy’s m posted a higher profit despite lower sales thanks to better inventory management and cost-cutting.