Tesla, the luxury electric carmaker, said on Thursday that it would shut down production at its San Francisco Bay Area factory, which has remained open for several days in apparent defiance of a local county order.

The carmaker had caused uproar by continuing production even after Alameda County officials issued a shelter-at-home order that applied to businesses and individuals. Tesla did not qualify as an “essential business,” which would have exempted it from the order. As recently as Wednesday, the company was telling employees they could stay home if they were worried about the coronavirus outbreak but would have to use their time off if they wanted to be paid.

“In the past few days, we have met with local, state and federal officials,” Tesla said in a statement on Thursday. “Despite taking all known health precautions, continued operations in certain locations has caused challenges for our employees, their families and our suppliers.”

Production at the factory, in Fremont, Calif., will stop at the end of the day Monday to allow for an “orderly shutdown,” the company said. It will also temporarily suspend production at a factory in Buffalo. Work elsewhere, including at its Gigafactory in Nevada, will continue, it said. Tesla also said that it had continued operating out of its Fremont factory at the “federal government’s direction.”