On Twitter, Musk also threatened to sue over Alameda County Health Department coronavirus restrictions that have stopped Tesla from restarting production its factory in Fremont south of San Francisco.
"Frankly, this is the final straw," he tweeted. "Tesla will now move its HQ and future programs to Texas/Nevada immediately."
Tesla is filing a lawsuit against Alameda County immediately. The unelected & ignorant “Interim Health Officer” of Alameda is acting contrary to the Governor, the President, our Constitutional freedoms & just plain common sense!— Elon Musk (@elonmusk) May 9, 2020
Frankly, this is the final straw. Tesla will now move its HQ and future programs to Texas/Nevada immediately. If we even retain Fremont manufacturing activity at all, it will be dependen on how Tesla is treated in the future. Tesla is the last carmaker left in CA.— Elon Musk (@elonmusk) May 9, 2020
He wrote that whether the company keeps any manufacturing in Fremont depends on how Tesla is treated in the future.
Musk has been ranting about the stay-home order since the company's April 29 first-quarter earnings were released, calling the restrictions fascist and urging governments to stop taking people's freedom.
RELATED: Elon Musk and Grimes reveal how to pronounce name of baby X A-12
An order in the six-county San Francisco Bay Area forced Tesla to close the Fremont plant starting March 23 to help prevent the virus' spread, and it was extended until the end of May. Public health experts say the orders have reduced the number of new coronavirus cases nationwide. California Gov. Gavin Newsom allowed the Bay Area counties to continue restrictions while easing them in other areas of the state,
Emails seeking comments Saturday from Alameda County's public health officer and Newsom have not been returned.
The coronavirus causes mild or moderate symptoms for most people. But it has killed more than 77,000 people in the U.S., with the death toll rising.
Musk's tweets come as competing automakers are starting to reopen factories in the U.S. Toyota will restart production on Monday, while General Motors, Ford and Fiat Chrysler all plan to restart their plants gradually on May 18. Tesla is the only automaker with a factory in California.
Musk's threats came after a series of bizarre tweets earlier this month including one that said Tesla's stock price was too high. Musk also posted parts of the U.S. national anthem and wrote that he would sell his houses and other possessions.