Pacific Gas and Electric Co., in another dramatic move to prevent San Francisco from operating a lucrative public-power system, is moving to block the city from delivering its own Hetch Hetchy power even to city agencies and the tenants of city departments.

The move by the giant private utility will come before a federal administrative law judge next month.

The filings are immensely complicated, but they amount to this: PG&E wants to take customers away from the city’s power agency – or force the city to spend as much as $600 million building new electric power lines.

City Attorney Dennis Herrera has filed suit to block PG&E’s efforts in a case that revives a scandal more than 100 years old.

Under the federal Raker Act, passed in 1913, San Francisco is required to operate a municipal power system selling cheap electricity to residential and commercial customers; PG&E isn’t supposed to do business in this town.

But the company has thwarted every effort to enforce the law, despite a US Supreme Court ruling, court injunctions, the intervention of the Department of the Interior and private lawsuits. You can read the whole history of this, which I wrote for the Bay Guardian, here.

San Francisco operates a series of hydropower facilities fed by the O’Shaughnessy Dam, in Yosemite National Park. It’s a fascinating part of the city’s history: After the 1906 earthquake (110 years ago today!), San Francisco needed a reliable water source, but most of the usable sites on Northern California rivers had already been claimed.

So Mayor Phelan filed for water rights on the Tuolumne River and proposed building a dam in Hetch Hetchy Valley, which happened to be in Yosemite.

You aren’t supposed to build dams in national parks. The Sierra Club was founded in part over opposition to the plan, and John Muir found it unacceptable. But at the same time that the growing conservation movement opposed the destruction of nature, another growing movement believed that electricity, which was replacing steam as the engine of industrial progress, should never be controlled by private companies.

The Raker Act was the grand compromise: the dam would be allowed, but only if it was used both for water and electric power. Testimony in Congress at the time makes clear that the sponsors of the bill wanted to end the growing influence of PG&E and prevent private electric companies from controlling the Northern California grid. They traded the destruction of a magnificent valley in a public park for the promise that electricity would be generated and sold for the people, not for profit.

That, of course, never came to pass, and most of us pay our bills to PG&E today.

The City Attorney’s Office has been very cautious over the years about invoking the Raker Act, since any true discussion of the history of the act would lead to the conclusion that the city (that is, the client of the city attorney) is in violation of federal law.

But Herrera has gone further than any of his predecessors, and further than he’s ever gone himself, in discussing this case:

Almost immediately after passage of the 1913 Raker Act—which created San Francisco’s Hetch Hetchy Reservoir and the city-owned hydropower system sited there—PG&E began systematically blocking San Francisco’s fledgling public power enterprise from completing its own electricity distribution system. For decades thereafter, PG&E wielded the advantages of its market monopoly and limitless political spending in a stranglehold over city efforts to fulfill the promise of a locally-owned power enterprise, which federal and local law both envisioned since the early 20th century. The private utility spent millions defeating efforts by successive generations of city leaders to win voter approval for bonds to build such a system. All failed at the polls. As a result, San Francisco taxpayers have for years relied on service agreements and federal tariffs to utilize PG&E’s existing distribution facilities where San Francisco lacked its own—on terms that have unavoidably favored the interests of PG&E shareholders.

As part of the tortured compromises the city has reached over the years, San Francisco still gets to use the Hetch Hetchy power for Muni, the lights at City Hall, the public schools, city buildings, and other municipal needs.

That’s what PG&E is now trying to mess with.

In the process, the utility is opening a can of electric worms: If PG&E gets its way, the city could be forced to build, at significant expense, its own distribution system – which in the long run is probably a good idea and might make the company irrelevant in its home town.

Of course, if that happens, PG&E will spend a fortune, as it always does, trying to block the city from selling the bonds it would need to build its own electricity infrastructure – and since that’s worked a dozen or more times in the past century, the utility seems confident that it can win either way and that the city and the taxpayers will be squeezed.

This chapter of the story goes back to 1987, when I was still a young reporter covering a story that made my head spin. PG&E and the city were negotiation a set of long-term contracts; the company wanted to charge the city a hefty fee for the right to deliver electricity to city agencies along PG&E’s power lines.

The city staffers working on the deal were outraged by PG&E’s demands, and, according to documents I got, said the proposed deal was terrible for the taxpayers. But then-mayor (now senator) Dianne Feinstein personally intervened after getting a call from the head of PG&E. She ordered the staff to give the company everything it wanted.

That meant high fees – and rules that would limit the ability of the city to find new customers for its power.

The deal went to the Board of Supes, where the budget analyst, in an unusual move, strongly urged the members to reject it, saying it would cost the city hundreds of millions of dollars.

After a full-court lobbying effort by PG&E, the board voted 8-3 to approve the deal anyway.

But the contracts expired in 2015 – and in the meantime, while the city was getting soaked, the federal government passed a new rule that mandated that private electric utilities make their lines available at a reasonable fee for competitors in the market.

“We were looking forward to the end of the contracts,” Matt Dorsey, a spokesperson for Herrera, told me. “This was a chance to get rid of the old restrictions and fees.”

Now PG&E is trying another approach. The company argues in federal filings that it should only be required to deliver the city’s power to existing city customers – and defines existing in a way that would make it almost impossible for the city to continue to power its own agencies.

For example, according to the city’s filings with the Federal Energy Regulatory Commission, a police station that moved across the street would no longer be an existing customer. A new tenant at the Port, replacing a tenant that moved on, would not be an existing customer. The city would lose as many as 30 percent of its customers over the next ten years, the filing states.

And what does that mean? As the filing states, “Any customer that the city is unable to serve becomes a retail customer of PG&E.”

The utility is going further. It says that the city can’t serve any new customers (including new locations for city agencies or tenants of city agencies) unless it builds its own power lines to connect to those customers. That could cost as much as $600 million over the next ten years.

Of course, PG&E doesn’t want the city to build its own power lines, which it ought to do anyway. Every time the city has tried to pass a bond act to create municipal power infrastructure, PG&E has spent vast sums of money to shoot the plan down.

And I don’t see Mayor Ed Lee, who loves PG&E, supporting a plan to build a public-power infrastructure that would cost the utility its biggest and most profitable territory.

All of this is happening at the same time that the city is moving forward with CleanPowerSF, an alternative that offers cheaper, greener electricity to residential and commercial customers. PG&E is doing its best, of course, to undermine the program.

The whole legal battle shows just how desperate the local private utility has become. With its inability to meet even reasonable climate goals, its reliance on nuclear power, and its high rates, PG&E is increasingly unpopular in the city.

At the same time, the advent of cheap rooftop solar and other forms of distributed generation, combined with programs like CleanPowerSF, are a threat to the entire model of the investor-owned, centralized power company.

Now PG&E is trying to undermine an existing arrangement that allows the city to use its own electricity – and it the process, is making itself even more vulnerable.

“We are in a good position,” Dorsey told me. “This could be a defining battle.”