Tesla CEO Elon Musk is threatening to sue San Francisco’s Alameda County and move the company out of California over the county’s strict shelter-in-place rules.

Musk went on Twitter Sunday to express his disagreement with the county’s decision not to let certain businesses reopen, despite other areas of the state allowing it. On Friday, California Gov. Gavin Newsom permitted low-risk businesses, like stores selling books, clothing, flowers and sports goods, to reopen under some restrictions.

Dr. Erica Pan, the interim public health officer in Alameda County, said the area still needs to maintain shelter-in-place guidelines, which prevents the Fremont, Calif., Tesla location from resuming vehicle production.

“Tesla is filing a lawsuit against Alameda County immediately. The unelected and ignorant ‘interim health officer’ of Alameda is acting contrary to the governor, the president, our constitutional freedoms and just plain common sense,” Musk tweeted. “Frankly, this is the last straw. Tesla will now move its HQ and future programs to Texas/Nevada immediately. If we even retain Fremont manufacturing at all, it will be dependent on how Tesla is treated in the future. Tesla is the last carmaker left in California.”

Neighboring county San Joaquin has begun preparations to reopen some of its businesses, which prompted Musk to call Alameda County “irrational” and “detached from reality.”

In a public statement, Fremont Mayor Lily Mei supported Tesla and encouraged Alameda County to work with local businesses to create reopening guidelines.

“As the local shelter-in-place order continues without provisions for major manufacturing activity, such as Tesla, to resume, I am growing concerned about the potential implications for our regional economy. We know many essential businesses have proven they can successfully operate using strict safety and social distancing practices. I strongly believe these same practices could be possible for other manufacturing businesses, especially those that are so critical to our employment base. The City encourages the County to engage with our local businesses to come up with acceptable guidelines for re-opening our local economy.  As we have done for over a decade, the City is prepared to support Tesla as soon as they are able to resume automobile manufacturing operations and are committed to a thoughtful, balanced approach to this effort that remains safe for our Fremont community.”

At the end of April, Alameda County extended its shelter-in-place rules through May 31.