Regulators in California, home to more residential solar customers than any other state, agreed on Thursday to retain a system that compensates users of rooftop solar panels for their excess electricity.

The decision was closely watched by energy officials and executives across the country, who are grappling with huge shifts in the power industry stemming from the spread of renewable energy.

“States pay close attention to leading markets, and they pay close attention to how changes to policy impacts markets,” jobs, consumer satisfaction and investment, said Sara Baldwin Auck, regulatory director at the Interstate Renewable Energy Council, a nonprofit policy group that supports clean energy.

At least 20 states are re-examining their policies, she said. At issue in all of them is how to value electricity when it flows from customers to utilities, rather than the other way around.

Under so-called net metering, customers receive credits on their bills for the unused energy their panels produce. Most states have such policies, but the amounts vary, with some offering credits near wholesale energy prices and others, like California, offering the retail rate.

Solar advocates and installers say customers should receive the retail rate because the power they generate helps the electrical infrastructure, by lowering strain on the grid or helping reduce the need to buy power at expensive prices in times of high demand.

But some ratepayer advocates and the utilities, which lose out on electricity sales and some of the infrastructure costs that are bundled into retail rates, say that solar customers put an undue burden on nonsolar customers, who must make up that shortfall.

In California, regulators sided mainly with the solar industry and its proponents and generally rejected proposals to reduce the net-metering credit and add a slate of new charges, though it added some new rates and fees.

The net-metering program, narrowly approved by a vote of 3-2 by the California Public Utilities Commission, will require that new solar customers pay a one-time interconnection fee, estimated between $75 and $150, and begin paying fees of a few cents a kilowatt-hour that most other customers already pay. Those charges fund low-income and energy efficiency programs.

Solar customers will also be compensated at different rates depending on when they send their excess power to the grid, a change that will alter the economics of the system but not undo its appeal, experts said.

The changes do not affect customers who already have solar panels or who install them before the utilities in their area reach certain levels of rooftop use in their service territories, which the California Solar Energy Industries Association, a trade group, estimates will happen by early next year. And regulators, who are to re-examine net metering again in 2019, left open the possibility that they could revise or add charges.

“Our course is not for the rooftop solar industry or for the utilities or the community clean energy aggregators,” Michael Picker, the utility commission president, said in a prepared statement. “Our decision today is another big step toward giving California consumers more choice, more control and more responsibility over energy and climate change issues.”

Bernadette Del Chiaro, executive director of the California Solar Energy Industries Association, said the decision was an important statement that California would continue to develop microgrids and decentralize energy production.