J.C. Penney (NYSE:JCP) has fought back from the brink.

The company, which once seemed like an inevitable retail casualty, has not solved all its problems, but it did show major signs of improvement in 2016. That's why the chain impressed investors, as it went from being volatile throughout the year to the stock ending it dramatically higher.

What happened

Through three quarters of 2016, J.C. Penney made progress toward becoming a viable, profitable business once again. In Q3, for example, the retailer saw a 0.8% drop in same-store sales, but saw its loss improve 42% versus the prior year to minus $67 million. Of course, that's still a loss, but it's a further sign the company has pulled itself back from imminent danger.

Those numbers, along with the results from the previous two quarters, were taken as strong positives by investors. Shares started the year down from 2015 highs because holiday sales lagged expectations, but the company quickly recovered. After closing 2015 at $6.66 shares, it ended 2016 at $8.31, a 25% improvement, according to data from S&P Global Market Intelligence.

JCP Chart

Data source: YCharts.com.

So what

Investors clearly believe in J.C. Penney CEO Marvin Ellison. He has improved results and shown that the company can carefully manage its way back from the edge of falling into consumer irrelevancy and inevitable bankruptcy.

"We are pleased to see strong sales performance in the growth initiatives we discussed at our most recent analyst meeting," he said in the Q3 earnings release. "The results of these initiatives are reflected in a positive sales comp in the month of October, driven by over 200 basis points of comp benefit from our 500 new appliance showrooms. We view our October sales results -- specifically our acceleration in the last two weeks of the month -- and the benefit from appliances as examples of what we expect for the balance of the fourth quarter."

A J.C. Penney store

J.C. Penney has won back trust from investors. Image source: J.C. Penney.

Now what

J.C. Penney's road back has been bumpy. As you can see from the stock chart above, the company has had its share of setbacks. It appears that holiday results from 2016 are at least partly one of those bumps in the road.

"The first three weeks of November proved to be challenging in stores, consistent with the trends in the broader retail industry, said Ellison in a preliminary sales report. "However, the business improved and overall comp sales for the six-week period from Thanksgiving week through the end of December were positive... We are also encouraged by a very strong performance in our e-commerce business, evidenced by double-digit growth."

That's not all bad, but it's less than what the company hoped for given the momentum it had heading into the season. In order to build long-term success, the retailer has to continue to adjust and find a way to sustain success. There were strong signs in 2016 that it could do that and that J.C. Penney has a future.

Daniel Kline has no position in any stocks mentioned. The Motley Fool has no position in any of the stocks mentioned. The Motley Fool has a disclosure policy.