Silicon Valley titan Elon Musk likes to do it his way. And when he can’t, he rarely holds back.

Musk’s combative nature revealed itself again this weekend when the Tesla and SpaceX chief executive challenged Alameda County government officials about reopening his electric car manufacturing plant in Fremont in the wake of the coronavirus pandemic.

In a Saturday night fit, Musk had a lawyer file a lawsuit in U.S. District Court in San Francisco to block Alameda County from enforcing an order that prevents the plant from reopening immediately. He went to court even though Alameda County Supervisor Scott Haggerty said Sunday they were close to an agreement to reopen the plant in the coming week.

The federal suit also argued that local government officials had overstepped their authority: “Alameda County’s power-grab not only defies the Governor’s Order, but offends the federal and California constitutions,” the lawsuit said.

The controversial action was the latest in the past month by the iconoclastic billionaire best known as a serial entrepreneur and serial tweeter.

To wit:

— Tweeting Saturday night, Musk said he would move Tesla’s headquarters from Palo Alto to Texas or Nevada, states with favorable tax laws that have been luring California companies for the past decade.

— Wednesday, Musk put two multimillion-dollar Bel Air mansions on the market after saying he would sell almost all physical possessions. “Don’t need the cash,” he tweeted. “Devoting myself to Mars and Earth. Possession just weigh you down.”

— On Tuesday, Musk and Grimes, the Canadian musician Claire Elise Boucher, announced on Twitter the birth of their newborn boy. They named him X Æ A-12 Musk.

–On May 1, Musk tweeted that Tesla’s stock prices were too high, causing an immediate 10 percent drop. (The stock rebounded and closed Friday 7.78 percent higher than the day of the tweet.)

— In an April 29 conference call with reporters, Musk lashed out at shelter-in-place orders. “To say they cannot leave their house and that they will be arrested if they do, that’s fascist,” he said. “That is not democratic — this is not freedom. Give people back their goddamn freedom.”

Russell Hancock, president and CEO of Joint Venture Silicon Valley, did not flinch when learning of Musk’s threat to abandon the Bay Area.

“Nothing ever surprises me anymore when it is related to Elon Musk,” he said Sunday. “I’m sure there are more surprises to come.”

Hancock described Musk’s remarks as “extreme impatience. We can completely understand it. Nobody gets to do anything they would like to do” while dealing with a global pandemic.

But Musk, a South African immigrant worth almost $40 billion, according to reports, is used to getting his way. And he is not afraid to air his frustrations publicly when he doesn’t.

With 33.9 million followers on Twitter, Musk commands a large audience. He did not respond Sunday to requests to talk about the Tesla situation through Twitter and email. Tesla Inc. also did not respond to an email request for comment.

“There is a reason he builds rockets: He moves at the speed of sound,” said Haggerty, the Alameda County supervisor who helped bring Tesla to the former General Motors Fremont assembly plant in 2010. “It is hard for people to keep up with him.”

Haggerty said Tesla officials threatened Thursday to sue Alameda County over the plant closure. The weekend filing still surprised him.

“I don’t think he is going to leave,” Haggerty said. “I think he wants to feel valued.”

Nevada would be a happy beneficiary if Musk does follow through with the threats, said Cara Clarke, vice president of the Las Vegas chamber of commerce.

“Nevada is always looking to diversify and expand businesses here,” she said Sunday. “Right now in this tentative economy, new jobs are something we would welcome.”

The 5.3-million-square foot Tesla plant that assembles the Model 3, Model S, Model X and Model Y vehicles temporarily closed March 23 to comply with the shelter-in-place order after first defying public health officials. It appeared the electric carmaker would reopen about the same time as America’s three big automakers that are scheduled to resume operations on May 18.

“We were close, we were really close,” said Haggerty, who added he had been working with Tesla executives and county health officials for three weeks to create a safety plan. “For some reason, Elon had it in his mind he wanted to open it this week. For the life of me, I don’t understand why Elon couldn’t wait a few more days.”

Hancock hopes the latest dispute does not lead to relocation.

“You’re talking about severing ties to 14,000 people who have given their lives to Tesla, who are loyal, devoted, who he cares about,” Hancock said of the plant’s workforce.

“It would be a cold-hearted move on his part, and it also would involve all kinds of start-up costs, relocation costs. None of this makes sense.”

Plus, Hancock added, Tesla is a technology company: “Silicon Valley and Elon Musk were made for each other,” he said.

Haggerty called for the immediate opening of the economy while also praising the work by the Bay Area county public health officials who took early action to try to stop the spread of COVID-19. Such measured comments usually are not found on Musk’s unfiltered Twitter feed.

“He’s made of that stuff that made California, that made the Wild West, made Silicon Valley,” Hancock said. “He’s a maverick, he’s a renegade, he’s an innovator and a disruptor.”

Now the question is how far will Musk go to make his latest point.