San Francisco has become the first major city in the country to require solar panels on new residential and commercial buildings of under 10 stories.

The San Francisco Board of Supervisors unanimously passed the legislation on Tuesday. Supervisor Scott Wiener, who drafted the measure, said it's the first of its kind in a major U.S. city.

California already mandates that new buildings with 10 floors or less make at least 15 percent of their rooftop areas "solar ready." Now, San Francisco requires solar panels to be installed in these areas starting in 2017. It can take the form of either solar photovoltaic or solar water panels, both of which supply 100 percent renewable energy, his office said.

Larger buildings are exempt for now.

Wiener said the legislation will help move San Francisco toward its goal of meeting 100 percent of the city’s electricity demand with renewable energy.

"By increasing our use of solar power, San Francisco is once again leading the nation in the fight against climate change and the reduction of our reliance on fossil fuels," Wiener said in a statement. "Activating underutilized roof space is a smart and efficient way to promote the use of solar energy and improve our environment. We need to continue to pursue aggressive renewable energy policies to ensure a sustainable future for our city and our region."

It would affect roughly 200 building currently in the works, Wiener's representative told NBC Bay Area.

San Francisco isn't the first California city to push for solar panels. In 2008, Berkeley launched a special financing program for those using renewable and solar panels. And in 2014, Palo Alto passed a resolution to increase the installation of local solar photovoltaic facilities in order to provide four percent of the city’s total energy needs by 2023.