New York City will spend $23 million to install solar-paneled roofs on 24 public schools, thereby tripling the amount of sun power collected on city-owned buildings now, Mayor Bill de Blasio has announced.

News of the installations comes about a week after New York became the largest municipality to commit to a goal of reducing greenhouse emissions from public and private buildings 80 percent by 2050, down from 2005 use levels, according to a report by Bloomberg.

The total investment will actually cost about $28 million, but $5 million will be offset by state grants under Governor Andrew Cuomo's NY-Sun Initiative.

During a press event outside John F. Kennedy High School in the Bronx, one of the first schools in the system to power classrooms with solar energy, de Blasio asserted the city's transition to renewable energy indeed provides a way to support new technology and cut costs, but also, said the Bloombert piece, fulfills a "moral imperative"

New York City, said de Blasio, is "one step closer today to handing off a planet that will be a safe place for future generations ... It's the right thing to do for our children and grandchildren."

De Blasio has said he wants to generate 100 megawatts of solar power on public buildings and 250 megawatts on private properties in 10 years.

That, he said, would generate 1 percent of the city's electricity, reducing greenhouse-gas emissions by approximately 35,000 metric tons a year.

On the other hand, If private targets aren't met, de Blasio said he would use incentives and mandates to persuade building owners to invest in solar.

Back at JFK High School, the panel installations -- each of which is expected to generate 6.25 megawatts of power -- will coincide with an environmental curriculum that will teach students how to track in real time the amount of energy the system generates and the impact it has on emission reduction.

Producing energy even in overcast conditions, the panels, said the mayor, could prove helpful during natural disasters like Hurricane Sandy, which cut the power supply to more than 2 million New York households, a U.S. Commerce Department report said.