(Reuters) - J.C. Penney Co Inc JCP.N reported a smaller-than-expected quarterly loss on Thursday, as the department store operator's efforts to cut costs and shutter unprofitable businesses paid off, sending shares of its penny stock higher by as much as 14%.

FILE PHOTO: Levi's men clothing is pictured inside a JC Penney store in Oceanside, California, U.S., July 31, 2019. REUTERS/Mike Blake/File Photo

The 117-year-old retailer, one of the worst-hit by the surge in online shopping in the past decade, reaffirmed it expected positive free cash flow this year and would have funds of around $1.5 billion available at the end of 2019.

Last month, Reuters exclusively reported that the company had hired advisers to explore debt restructuring options.

The Plano, Texas-based retailer also gave a forecast for 2019, the first full-year outlook it has given since withdrawing its 2018 expectations in November to give new Chief Executive Jill Soltau time to settle in.

Penney’s sales continue to fall, down 9% in the quarter, and it forecast that comparable sales would drop in 2019 between 7% and 8%, worse than current analysts’ expectations, according to Refinitiv data.

But the company’s net loss more than halved, to $48 million, compared with the same period a year ago, and Soltau said the company was benefiting from a reduction in excess inventory and reining in permanent price markdowns.

“While we still have work to do on our topline, I strongly believe that growing sales in an unprofitable way is simply not an option,” she said.

The company announced on Thursday it would start selling secondhand women’s clothing and handbags at 30 stores in partnership with fashion resale marketplace thredUP, starting this week.

“With the exponential growth in resale, there’s no doubt that demand for affordable luxury is at an all-time high,” Soltau said. “There’s an emotional thrill that comes with finding a high-quality, secondhand products for much less.”

Slideshow ( 2 images )

Rival Macy's Inc M.N also announced a partnership with resale company thredUP a day prior, underscoring how department stores are aiming to reach a new and younger customer in fresh ways.

Gordon Haskett analyst Chuck Grom said Penney’s improvement in gross profit margin, which rose to 39.5% from 35.3% a year ago, was “the big upside surprise in the quarter – led by lower markdowns, better shrink control, and overall better merchandise margin rates,” adding that “these factors should trump the top-line weakness, which is partly self-inflicted.”

To stem falling sales, boost margins and ultimately reassure investors it can lure shoppers back into stores amid fierce competition from online giants like Amazon.com Inc AMZN.O and discount retailers like TJX Cos Inc's TJX.N Marshalls and T.J. Maxx chains, Soltau has been reducing inventory at stores and closing underperforming outlets.

Earlier this year, Soltau chose to stop selling major appliances and furniture in store, re-focusing on the retailer’s once-thriving and higher-margin apparel business.

Fine jewelry, women’s and men’s apparel and footwear outperformed in the second quarter, ended Aug. 3, the company said, while women’s accessories underperformed.

Soltau, hired late last year from craft and fabrics seller Jo-Ann Stores, told investors on a post-earnings call the ongoing trade spat between the United States and China has had “minimal impact” on the business thus far, and that Penney has and will continue to diversify its sourcing and reduce its exposure to China.

Excluding items, Penney posted a loss of 18 cents per share, lower than estimates of 31 cents.

Penney ended the quarter with liquidity of about $1.70 billion.

Shares in the company have fallen 45% this year as of Wednesday’s close. On Thursday, they were up 4% at $0.59 in afternoon trade.

Last week, the New York Stock Exchange said Penney had six months to get its stock price above $1 or its shares could be de-listed.