The San Francisco Bay Area is in lockdown to fight the spread of the coronavirus. Under a "shelter in place" order announced Monday, people in seven Bay Area counties are prohibited from leaving their homes except for essential activities like visiting the doctor or buying food.

Tesla's Fremont car factory is in Alameda County, which is participating in the lockdown. But Tesla CEO Elon Musk has been defiant. In a Monday evening email, he told employees that they could stay home from work if they felt sick. However, he wrote, "I will personally be at work" on Tuesday.

But late on Tuesday, the Alameda County Sheriff's office fired a shot across Tesla's bow:

Tesla: @Tesla is not an essential business as defined in the Alameda County Health Order. Tesla can maintain minimum basic operations per the Alameda County Health Order. — Alameda County Sheriff (@ACSOSheriffs) March 17, 2020

Alameda County's Monday order directed businesses in the county to "cease all activities at facilities located within the County except Minimum Basic Operations"—like processing payroll.

It's a serious setback for Tesla because the Fremont factory is Tesla's only significant auto manufacturing facility outside of China. The factory has been cranking out thousands of Model 3 vehicles every week and had just begun making the Model Y crossover.

Tesla's stock plunged on news that Tesla could be forced to shut down its Fremont factory. As of publication time, Tesla's stock is down more than 11 percent at $380. That's down from a high above $900 the stock hit just last month—before the economic impact of the coronavirus became clear.

Other car stocks are also being hit hard. Ford's stock is down 12 percent, while GM's stock has fallen 21 percent since Tuesday's close.

Around the world, carmakers have been suspending production in response to the pandemic. Volkswagen, BMW, Daimler, and Ford have all announced plans to shut down European factories. Toyota is planning to shut down factories in both Europe and Asia. Honda announced the closure of its North American factories on Wednesday.

But American automakers are hoping to keep running their factories in the United States. On Wednesday, Detroit's Big Three automakers announced tentative deals with the United Auto Workers to continue manufacturing. Under the deals, carmakers will reduce operating hours to provide more time for deep cleaning between shifts. They will also take measures to increase the physical distance between workers—though details about this remain to be worked out.