In a major test of the Bay Area’s shelter-in-place edict, Alameda County on Tuesday evening deemed Tesla’s Fremont factory a “nonessential” business — hours after Chief Executive Elon Musk opened the plant and told his employees he would continue working despite a seven-county shutdown of virtually all major workplaces aimed at slowing the spread of the coronavirus.

“If Tesla was a hospital, if Tesla was a laundromat, if Tesla was a mechanic shop, we wouldn’t be having this conversation,” Alameda County spokesman Sgt. Ray Kelly said. “But Tesla makes cars, and that’s not essential for us to get through this health crisis.”

Musk had told employees that he would “personally be at work” despite the ongoing coronavirus crisis.

Musk had said that while the company’s factory would remain open, Tesla workers should put their health first and that it was “totally OK” for employees to stay home.

“I’d like to be super clear that if you feel the slightest bit ill or even uncomfortable, please do not feel obligated to come to work,” Musk said in his email. He added that, “the best of our knowledge, no one at Tesla (over 56,000 people) has tested positive for COVID-19. I will inform you immediately if anything changes.”

News of the email came just one day after Alameda County joined six other Bay Area counties in issuing an order for residents to “shelter at home” until April 7, telling all residents to remain at home except for reasons such as buying food, going to the doctor or for work deemed “essential,” including medical care and grocery and pharmacy services.

Word that Musk planned to keep the Fremont factory — one of the largest employers in Alameda County — open sent county lawyers, administrators and health officials into discussions over whether the electric car maker’s operations would be considered essential and if the factory remaining open would create a greater risk of exposure to the COVID-19 strain of coronavirus for workers in the Bay Area.

Ultimately, the offices of Alameda County Administrator Susan Muranishi, County Counsel Donna Ziegler and County Public Health Officials made the decision about Tesla, Kelly said. The company was not alone in questioning the order, although it appears to be the largest employer to have done so.

Tesla, like other Alameda County businesses, can maintain basic functions under the shelter-in-place order, Kelly said. Those functions include maintaining the factory’s infrastructure and office work such as payroll but do not not include the manufacturing of electric cars.

The Fremont factory, where Tesla builds its Model 3, Model X, Model S and Model Y vehicles, employs an estimated 10,000 people.

Tesla did not immediately return a request for comment on the county’s decision or an earlier request for comment about its operations during the shelter-in-place period.

State Sen. Bob Wieckowski, who represents the East Bay and South Bay, said his office received calls from business owners confused over whether they qualified as essential and allowed to continue to conduct business.The senator said those questioning the order included a food processing plant in Hayward.

Fremont Councilman Vinnie Bacon, who remains in the running for the District 1 Alameda County supervisor seat, said Tuesday that he was surprised to hear that Tesla’s Fremont plant remained open.

Tesla “doesn’t seem like it’s part of our critical infrastructure,” Bacon said. “Will you be paid if you are not there? If people are not getting paid for not showing up then obviously you are effectively being asked to go in.”

Musk previously has been dismissive about the threat posed by the spread of the disease, tweeting last week that “The coronavirus panic is dumb.” Late Monday, he tweeted a link to the Centers for Disease Control’s website that updates the latest figures for coronavirus cases in the United States, adding: “danger of panic still far exceeds danger of corona imo. If we over-allocate medical resources to corona, it will come at expense of treating other illnesses.”