Minnesota bucked the national trend in solar energy employment in 2017, posting the second highest job growth by state.

Nationwide, U.S. solar energy industry employment fell by 4 percent or 9,800 jobs, according to a report released Wednesday by The Solar Foundation. It was the first decline since The Solar Foundation began tracking jobs in 2010.

Total U.S. solar employment was 250,271 last year, with the majority of those jobs in installation.

In Minnesota last year, solar employment grew 48 percent, hitting 4,256 jobs, according to The Solar Foundation. Only Delaware had a larger growth rate: 51 percent. "Minnesota was one of our brightest states in 2017," said Avery Palmer, a spokesman for The Solar Foundation.

Minnesota's job jump is rooted in the state-mandated Community Solar Garden program, which finally bloomed last year after many delays. The state had 58 community solar gardens up and running in December, compared to only ten a year earlier.

Xcel Energy administers the solar garden program, which was created in 2013. It's aimed at residents, businesses and governments that want solar energy without setting up their own rooftop arrays. Instead, they subscribe to larger arrays operated by independent companies that connect to Xcel's grid.

The Community Solar Garden program had the capacity to produce up to 211 megawatts of electricity in December. A megawatt is one million watts. Overall, the state added 467 megawatts of solar in 2017, enough to power 53,000 homes, according to the Minnesota Department of Commerce.

Nationally, California has the largest solar energy market, and also the most solar jobs -- 86,414, according to The Solar Foundation. Massachusetts and New York ranked second and third in 2017 with 11,530 and 9,012 jobs respectively. Minnesota ranked 16th.