SunPower  (SPWR) - Get Report  shares soared on Tuesday after Goldman Sachs analyst Brian Lee upgraded the San Jose, California, solar-panel maker and lifted his price target.

The stock shot up more than 26% to $10.46 following the upgrade to buy from neutral. Lee raised his price target for SunPower to $11 a share from $6.

Lee cited California's 2020 solar mandate, which effective Jan. 1 will require solar panels on all homes up to three stories.

The requirement is expected to provide a big boost to solar-panel sales. Panels currently sit on fewer than 10% of Golden State homes.

With one of the largest solar manufacturing plants in the country, SunPower also is benefiting from a tariff exemption U.S. trade officials granted on bifacial solar panels, which collect power on both their sides.

Shares of SunPower have been on the rebound in the six weeks since the company reported disappointing first-quarter results.

SunPower on May 9 reported a first-quarter loss of 41 cents a share, compared with the 40 cents estimated by analysts surveyed by Zacks.

Since closing at $7.38 after the report, SunPower shares have gained more than 40%.

"We executed well as we met or exceeded our key financial guidance metrics for the first quarter while laying the foundation for improved profitability in the second half of the year," said Tom Werner, SunPower chairman and chief executive, in a statement after the earnings report.