The fire was first reported around 8:25 p.m. and contained about 90 minutes later. The plant is located at 45500 Fremont Blvd.
RELATED: Tesla that caught fire in Los Gatos reignites at auto shop in Campbell
The fire was on the grounds of the Tesla plant outside the main building.
At first, officials thought the fire was a threat to the building, but they were eventually able to gain control.
Tesla has issued guidelines to fire departments on how to deal with battery fires, but firefighters had trouble identifying the source of the fire this time.
"Right now we're having a hard time identifying the actual material burning. We have some barrels labeled as corrosive, they are not involved. The attack crews are having issues suppressing it with foam. There's a possibility it's a thermal runaway with lithium batteries," a fire official could be heard on dispatch audio saying.
RELATED: Tesla trains firefighters how to put out its battery fires
There have been several incidents of the batteries in individual cars catching on fire.
Tesla's 2016 manual on dealing with battery fires is still current. It tells firefighters to use large amounts of water.
Firefighters have told ABC7 News in the past they still sometimes use foam because it works like a "smothering blanket."
See more stories about Tesla.