Tesla Inc.’s lone U.S. assembly plant posed a risk to public health by staying open for days in spite of San Francisco Bay area shelter-in-place orders, according to documents obtained through a California public records request.

Officials with the city of Fremont, California, told Tesla in a series of conversations over several days that its factory was not considered an essential business, and that it therefore needed to comply with an Alameda County order issued March 16. The electric-car maker announced March 19 that it would suspend production four days later.

The documents provide a more detailed glimpse of what was a contentious days-long debate between local authorities and Tesla, which sought to stay open based on how the federal government defines critical infrastructure sectors. Fremont’s police chief, the deputy city manager, the county’s health officer and its assistant counsel were among the officials who got involved in the dispute before Tesla backed down.