Pacific Gas and Electric Co. has agreed to pay $1 billion to more than a dozen local government agencies affected by recent devastating wildfires, including last year’s Camp Fire.

PG&E’s plan, announced Tuesday after days of mediation sessions in San Francisco, must still be approved in Bankruptcy Court and does not affect claims from individual residents or businesses who were victims of the wildfires.

Still, the agreement marks the first major settlement reached by PG&E since it filed for bankruptcy protection in January, largely because of its looming liabilities after the past two wildfire seasons. State investigators in May found PG&E responsible for starting the 2018 Camp Fire, the deadliest and most destructive wildfire in state history, and the utility’s equipment was also blamed for many of the wildfires that tore through Wine Country in 2017.

Most of the settlement money — more than $580 million of it — will go to agencies affected by the Camp Fire, including Butte County and the nearly destroyed town of Paradise. Another $415 million will be divvied up among a long list of agencies affected by the 2017 blazes, including Sonoma County, the city of Santa Rosa, Napa County and the city of Napa.

The rest of the money will go to the Calaveras County Water District because of the 2015 Butte Fire.

It’s not clear when any of them will actually be paid. The settlements will be included as part of PG&E’s plan to exit bankruptcy protection, and the company has the exclusive right to file one until September.

The public agencies will have wide latitude on how to spend their settlement funds, said Scott Summy, an attorney with the law firm Baron & Budd, which represented the governments.

“Their elected boards and advisers will determine how best they can use the money to rebuild or address their particular situation,” Summy said. “They’re in the best position to determine what they need and where they need it the most.”

PG&E called the settlement “an important first step toward an orderly, fair and expeditious resolution of wildfire claims” that demonstrates how willing the utility is “to work collaboratively with stakeholders to achieve mutually acceptable resolutions.”

“We hope to continue making progress with other stakeholders,” the company said.

A PG&E spokesman said the source of funds for the $1 billion settlement would be determined when the company submits its reorganization plan.

North Bay agencies are still deciding how they want to divide their share of the funds they’re set to receive, officials said. Sonoma County’s first priority will be infrastructure repairs, such as numerous stretches of roads that were damaged by the 2017 fires and the resulting debris removal, said Board of Supervisors Chairman David Rabbitt.

The PG&E settlement will allow Sonoma County — home to the hardest-hit fire zones of 2017 — to continue to move forward, Rabbitt said.

“We’ve been dealing with this pretty much nonstop as a county jurisdiction, and we probably will be for another couple of years at least,” he said. “It’ll be nice to get back to what we consider to be normal business — but with a much stronger, more resilient county.”

The settlement was also praised by one of Paradise’s legislative representatives, Assemblyman James Gallagher, R-Nicolaus (Sutter County). Gallagher said in a statement that he was “pleased to hear the utility company has moved quickly to accept responsibility and provide financial compensation” to the town where the Camp Fire brought the worst destruction.

Gallagher said it was “imperative” that the Bankruptcy Court approve the settlement quickly but said the most important step should be resolving claims from individual victims. The Camp Fire killed 85 people and destroyed more than 14,000 homes.

“Camp Fire survivors have already been through hell,” Gallagher said in his statement. “The utility has an obligation to not prolong their suffering.”

While PG&E has yet to settle the claims of individual fire victims, the utility did recently secure Bankruptcy Court approval of a $105 million fund for housing assistance and other urgent needs of survivors of the 2018 and 2017 infernos.

J.D. Morris is a San Francisco Chronicle staff writer. Email: jd.morris@sfchronicle.com Twitter: @thejdmorris