DOE gave them a $465 million loan to build out their Fremont factory during the height of the GFC:
https://www.energy.gov/lpo/tesla#:~:text=In%20January%202010...
> Tesla repaid its $465 million loan from the US Department of Energy (DoE) nine years early in 2013