Uber announced on Wednesday that it was permanently shutting down self-driving car testing in Arizona, laying off hundreds of workers in the state. The decision comes two months after an Uber self-driving car killed pedestrian Elaine Herzberg in Tempe. But the company insisted that it wasn't shutting down its self-driving car program as a whole. In an internal email obtained by Ars Technica, Uber said that it had a "goal of resuming operations in Pittsburgh this summer."

Hours later, Pittsburgh Mayor William Peduto released a press release blasting the plan. "Uber did not tell me of today's announcement, and I was forced to learn about it through social media reports," the mayor wrote. "This is not the way to rebuild a constructive working relationship with local government, especially when facing a public safety matter."

It's not clear if Peduto has the legal power to block Uber's return to Pittsburgh. But the mayor could certainly make Uber's life miserable if they decided to return to the city over Peduto's objections.

And Peduto's angry response points to a larger problem Uber now faces: if Uber wants to restart its self-driving car program, it's going to have to start testing somewhere. But even formerly friendly jurisdictions—like Pittsburgh, where Peduto once welcomed Uber with open arms—have soured on the company.

Uber was unable to convince Arizona Gov. Doug Ducey, one of the nation's most enthusiastic advocates of self-driving cars generally, to remove a March ban on Uber's testing in the state. And while Uber has talked of returning to testing in San Francisco, the company let its license to test driverless cars in California lapse days after the Tempe crash. So when Uber is ready to resume testing its cars later this year, it might find it has nowhere to do it.

Peduto laid out stringent conditions for Uber’s return

Peduto says he doesn't want Uber to return until a "full federal investigation" has been completed. He wants Uber to cap the speed of its self-driving car at 25 miles per hour—a speed that significantly reduces the odds that a crash will lead to a fatality. Peduto also wants Uber to modify its app to warn drivers of its conventional cars when they exceed the speed limit.

These are strong demands. Limiting testing to 25 miles per hour would put Uber at a disadvantage compared to competitors like Waymo and Cruise that are able to test at higher speeds in other states. And the National Transportation Safety Board, the lead agency investigating the crash, typically takes 12 to 18 months to issue its final report. So Peduto may effectively be asking Uber to keep its program suspended until mid-2019.

However, Peduto may not have the legal authority to prevent Uber from resuming self-driving car testing on Pittsburgh streets—a point mayoral spokesman Timothy McNulty more or less conceded in an email to Ars Technica."PennDOT has ultimate authority over the regulation of Pennsylvania roads," McNulty wrote. "Mayor Peduto has been in two-way talks with Uber since the accident on what the city would like to see should testing resume here."

But while Peduto may not have direct legal authority over Uber's testing activities, the Pittsburgh mayor has plenty of ways to make Uber's life difficult, says legal scholar Bryant Walker Smith.

"The mayor has soft power," Smith wrote in an email. Peduto "could publicly oppose Uber's activities (at a time when Uber wants support), encourage state legislators to pass a more restrictive law (some have been upset about Uber's testing for a while), coordinate with state regulators (including the Public Utility Commission), and direct greater police enforcement with respect to all of Uber's activities. (Would you like a police officer following you around and watching for infractions?)"

Peduto has evolved from an Uber booster to an Uber critic

Wednesday saw Peduto making full use of that soft power. In addition to his press release, Peduto waged a war of words with Uber on Twitter.

"As recently as Friday, we met with [the city of Pittsburgh] to discuss in detail how we could work together to return safely to self-driving operations," Uber tweeted.

Peduto fired back:

You never responded to our requirements. You never informed us of today’s announcement. You never followed up on my requirements after fatality in Arizona. Your PA lobbyist has ignored everything & instead has reached out to other electeds to cover your mistakes. Time to change! https://t.co/dIAtob9Z8O — bill peduto (@billpeduto) May 23, 2018

It's a remarkable change in tone for a mayor who was seen as a top Uber ally just two years ago. In 2015, Pittsburgh welcomed Uber's ride-sharing service at a time when a number of other cities were resisting the ride-sharing trend. In September 2016, Uber announced that Pittsburgh would be the first location for testing its self-driving cars. Mayor Peduto was enthusiastic.

"You can either put up red tape or roll out the red carpet,” Peduto said . “If you want to be a 21st-century laboratory for technology, you put out the carpet.”

But by mid-2017, relations had become strained, with Peduto charging that Uber hadn't lived up to its lofty promises. A year later, the relationship has gotten much worse, with Peduto seeming openly hostile to the ride-sharing giant.

Uber is running out of government allies

If Peduto manages to block Uber from returning to Pittsburgh, it will put the company's self-driving car project in an extremely difficult position. The company needs somewhere to test its vehicles if it's going to get its program back on track. But none of the options Uber is considering seem especially friendly.

Arizona Gov. Doug Ducey suspended Uber's testing program shortly after the March crash in Tempe, Arizona, and the ban was still in effect this week. Like Peduto, Ducey began as an enthusiastic supporter of Uber's self-driving car program, urging the company to bring its cars to the state last year.

In his internal email announcing Uber's withdrawal from Arizona, Uber executive Eric Meyhofer mentioned California—particularly San Francisco and Sacramento—as the other place where Uber hoped to resume testing.

But the company's license to test self-driving cars in the state expired in March , and Uber said at the time it was not planning to continue testing in the state. So if Uber wants to return to California, it will have to start the regulatory process from scratch. And the company has a long history of tensions with California regulators—Uber fled the state in late 2016 due to a regulatory dispute with state officials, only to return months later.

Uber also has a center for self-driving car technology in Toronto but hasn't announced any plans to test self-driving cars there

There are lots of other states with permissive laws for testing driverless cars, including Florida, Texas, and Nevada. But Uber could face the same basic problem wherever it goes: most state laws give officials at least some discretion in deciding which testing activity to allow. And in the wake of the March death—and increasing skepticism from regulators in Arizona, Pennsylvania, and California—regulators in other states are not going to be anxious to stick their necks out and take the risk that their jurisdiction could be the site of another Uber crash.

One possible option for Uber could be Ohio, right next door to Pennsylvania. Ohio Gov. John Kasich signed an executive order earlier this month legalizing self-driving car testing statewide. Even after the March crash in Arizona, Kasich has said he wants to make Ohio the "wild, wild west" for driverless car testing. "You’ll always have to take risks," Kasich said.