What happened 

Shares of high-efficiency solar manufacturer SunPower Corp. (SPWR 2.20%) jumped 27.5% in 2017, according to data provided by S&P Global Market Intelligence amid a challenging year for its industry. It wasn't all good news for SunPower, but the fact that demand for solar panels didn't collapse in the U.S. and China (as some investors had feared would happen) led to better than expected financial results and early indications of a turnaround. 

So what 

Operations didn't exactly thrive in 2017 -- SunPower reported losses of $2.03 per share for the first three quarters of the year.

Home with solar panels on the roof.

Image source: SunPower.

But U.S. solar demand remained strong, thanks in part due to the threat that President Trump might impose steep tariffs on imported solar panels. Developers rushed to buy panels ahead of that tariff decision, which pulled demand forward. The Chinese market was also much stronger than expected, likely passing 50 GW of solar installations, the most any country has ever built. 

The bright spots for SunPower were strong demand and margins in residential and commercial solar. In the third quarter, margins were 21.5% and 16.2% respectively, a massive improvement from the 15.3% and 3.6% margins it managed in Q1. As SunPower puts more focus on the residential and solar businesses, where high-efficiency panels are most valuable, it should be able to increase sales and margins in those businesses. 

Now what 

SunPower is by no means out of the woods and may be negatively impacted by tariffs if they're implemented in 2018. But its high-end products are seeing strong demand, and the company has demonstrated the ability to shift sales to other countries, as indicated by its being the leading winner of auctions in France. If its power plant strategy -- which includes new P-Series solar panels and an Oasis power block of inverters, trackers, and design services -- gains traction in 2018, the stock's recovery could continue.