Here’s a surprising figure, the federal government has spent more per year on solar power and other green energy programs in the last five years than it did on securing U.S. embassies.

“American taxpayers spent an average of $39 billion a year over the past 5 years financing grants, subsidizing tax credits, guaranteeing loans, bailing out failed solar energy boondoggles and otherwise underwriting every idea under the sun to make solar energy cheaper and more popular,” according to a report by the American Taxpayer Alliance.

Compare that $39 billion per year spent on green energy to the $2.7 billion the State Department spent on “embassy security, construction and maintenance” in 2014. President Obama’s 2016 budget proposal predicts the government will spend about $400 million less on embassy security, construction and maintenance in 2015 than in 2014. For 2016, Obama is asking for about $2.2 billion for embassy security, construction and maintenance.

This isn’t to say the U.S. isn’t spending enough on embassy security, especially in the wake of the 2012 attack on the consulate in Benghazi, but what this comparison shows is the sheer size of green energy spending by the federal government.

So why did green energy spending explode? The ATA report says that the 2009 stimulus package contained some $51 billion in spending for green energy projects, including funding for failed solar energy companies like Solyndra and Abound Solar.

Solyndra was given a $535 million loan guarantee by the Obama administration to manufacture solar panels. The company didn’t do a very good job and filed for bankruptcy in 2011. Abound Solar got a $400 million federal loan guarantee, but filed for bankruptcy in 2012 after using $70 million in taxpayer-backed loans. Abound was also making faulty panels that routinely caught fire.

The spending spree didn’t end there as the government has continued to spend billions — $39 billion per year, according to ATA’s report.

A 2012 Government Accountability Office report found there were at least 345 different federal programs supporting solar energy that were managed by 20 agencies. According to ATA, the federal government has spent $150 billion subsidizing solar power and other green energy projects. The IRS says there are $9 billion in green energy tax benefits every year and many states also subsidize green energy production.

“Government has attempted to support the solar industry by picking winners and losers in the marketplace, often failing miserably in the process,” according to ATA’s report. “There remains nearly unfettered access to public money by companies in the solar energy field and the limited risk assumed by businesses in the alternative energy arena due to governmental support leaves the industry is rife with poor decision-making and unseemly business practices.”

Green energy proponents argue that wind and solar power are needed to lower U.S. carbon dioxide emissions and tackle global warming. Supporters also say that green energy mandates and subsidies will help the country diversify its energy portfolio and become less reliant on foreign oil.

“From coast to coast, solar is having a huge impact on both our economy and environment,” said Rhone Resch, president of the Solar Energy Industries Association. “Today, the solar industry employs nearly 175,000 Americans and pumps more than $15 billion a year into the U.S. economy – and we’re just scratching the surface of our enormous potential.”

Despite billions in subsidies over the years, the Energy Information Administration predicts that solar power will only generate 0.6 percent of the total electricity generated in the U.S. in 2016.

Follow Michael on Twitter