Tucked among the undulating Solano County hills of Birds Landing, hundreds of wind turbines dot the landscape. Their blades pirouette through the air, whirring softly with each turn.

For years, the electricity they generate went to power companies and local energy programs in the Bay Area. Now the turbines are also powering homes and businesses in San Francisco through CleanPowerSF. After almost 12 years of political gridlock and stiff opposition from competitors, the green energy program began operating Sunday.

“We are being rewarded for the amount of time it took us to launch this program, because it is now better and more cost-effective than it would have been had we launched five years ago,” said Barbara Hale, assistant general manager for power at the San Francisco Public Utilities Commission.

CleanPowerSF is delivering electricity to more than 7,800 residences and businesses. For a program that faced multiple hurdles, including resistance from Mayor Ed Lee and attempts by Pacific Gas and Electric Co. to undermine it, the launch is considered a victory.

California’s goals of producing 33 percent of its power from green sources by 2020 and 50 percent by 2030 helped push CleanPowerSF across to the finish. As a city, San Francisco aimed even higher, with a goal of 100 percent renewable energy by 2030. As state and local policy drove the market, the renewable energy economy flourished, local green energy programs started in Sonoma and Marin, and prices dropped. The state’s Energy Commission estimates that almost 25 percent of electricity came from renewable sources in 2014.

“The pricing has dramatically changed, and renewable energy is a lot more affordable,” Hale said. “When we first starting talking about it, renewable energy was much more expensive. It was hard to imagine structuring a program that was financially viable and accessible for all San Franciscans, not just the wealthy. It’s beautiful that we are finally at this point.”

CleanPowerSF, which uses a community choice aggregation model similar to programs in Sonoma and Marin, works much like a buyers club for energy. The city purchases renewable electricity for residents, while PG&E delivers that energy on its electrical grid.

Customers are automatically transferred to CleanPowerSF in phases unless they opt out. In the first phase, supervisorial Districts Five, Eight and 10 were included. So far, less than 1 percent of customers have chosen not to participate. The entire city should be phased in within five years.

“We had projected that 20 percent of the folks that we auto-enrolled would opt out,” said Tyrone Jue, senior adviser on the environment to the mayor. “That’s what happened when Marin launched their program. No one has seen enrollment opt-outs as low as we are seeing. It’s part of the evolution of community choice aggregation in the state.”

The service is 0.25 percent less expensive than PG&E’s, though residents probably won’t notice a difference on their electricity bill. The standard option, green, is composed of 35 percent renewable energy. For about $6 to $15 more, residents can purchase the 100 percent renewable SuperGreen option.

“The program makes it easy for people to participate in our climate goals,” said Debbie Raphael, director of the San Francisco Department of the Environment. “Everybody needs to step up and use as much renewable energy as possible. As resources accumulate over the long haul, the city will have a pot of money to invest back in San Francisco. It’s a snowball effect.”

CleanPowerSF will help give residents more options, breaking PG&E’s power monopoly and helping the environment, Raphael said Friday. She stood underneath a giant wind turbine, watching workers on top fix a blade.

“We’re doing this,” she said. “People’s homes and businesses will be powered by this program. California and San Francisco are really leading the way for pushing renewable energy for everyone. That’s exciting. That’s amazing. I don’t have words.”

Lizzie Johnson is a San Francisco Chronicle staff writer. Email: ljohnson@sfchronicle.com Twitter: @LizzieJohnsonnn