Tesla Inc filed a lawsuit against Alameda County on Saturday to reverse orders that stopped the car manufacturer from restarting its facility in Fremont, California.

CNBC first reported the lawsuit, which is seeking injunctive and declaratory relief versus Alameda County. The case had been filed in the U.S. District court for Northern District of California.

Chief executive officer Elon Musk tweeted earlier Saturday that he was filing a charge against Alameda County and threatened to immediately transfer its main factory and future ventures to Nevada or Texas.

In his tweet, Musk said, "frankly, this is the final straw." He said that whether Tesla keeps any manufacturing in Fremont will depend on how the company is treated in the future.

Tesla had considered allowing a portion of its manufacturing employees to return to duty by Friday, but the Alameda County Health Department warned on Friday in a livestream that such move would breach the rules of the county.

Alameda County, where Tesla's facility is situated, is set to remain under lockdown until end of the month, At present, only businesses considered essential are authorized to open.

According to an Alameda County Public Health Department spokesperson, the car maker has been notified that they do not meet those criteria and must not reopent.

As part of its reopening program, Tesla had intended to bring back about 30 per cent of its manufacturing staff Friday, disobeying the stay-at-home order of Alameda County.

Musk based the reopening on new guidelines provided by California Gov. Gavin Newsom Thursday which allows factories to restart operations.

The guideline received praise from Musk, who later sent employees an internal memo about reopening plans based on the revised order from the governor. However, guidance from the governor included a warning that more restrictive rules could be kept in place by local governments.

Musk has been ranting about the stay-home order since the first-quarter earnings of the business were published April 29, calling the restrictions as fascist and urging governments to stop taking the liberty of the people.

A mandate in the six-county San Francisco Bay Area forced Tesla to shut the Fremont plant starting March 23 in order to help prevent the spread of the virus, and it was extended until the end of May.

Health experts say the orders have minimized the number of new cases of coronavirus across the country. Gov. Newsom allowed the counties of the Bay Area to maintain restrictions while loosening them in other parts of the state.