Tesla is moving its headquarters out of Palo Alto in California and transferring it to Texas. Tesla CEO Elon Musk said Thursday that its new headquarters will be built in the Lone Star State.

Musk said during a Tesla shareholder's meeting that its new headquarters will be built in Austin. After the applause over the announcement, Musk clarified that the company would not be completely abandoning California. He said Tesla will still be expanding its activities in the state.

"Just to be clear though, we will be continuing to expand our activities in California. So this is not a matter of, sort of, Tesla leaving California," Musk said.

Musk said Tesla is still moving forward with its plans to increase the output of its manufacturing facility in Fremont by at least 50%. He said the decision to move to Texas is partly due to the limited expansion opportunities in California, hindered by obstacles such as the state's high cost of living.

"It's tough for people to afford houses and a lot of people have to come in from far away. We're taking it as far as possible but there's a limit to how big you can scale it in the Bay Area," Musk said.

Musk said unlike its facilities in California, its new factory in Austin will be just five minutes away from the airport and 15 minutes away from the city's downtown.

Musk also cited California's "anti-biz policies," which are pushing him and other entrepreneurs away. He also described California as being like the winning teams that have gotten a "little complacent" and a "little entitled."

Musk and local officials in California previously got into an argument and then into a legal battle over Tesla's alleged violations of local COVID-19 restrictions. At the height of the conflict, Musk had threatened to move his companies' operations to Texas or Nevada.

Following the conflict, Musk decided to move his residence from California to Texas. At the time, Musk slammed the state for how it has been treating his company. He said the order to shut down his factory was the "final straw." Musk eventually decided to defy the state's orders and reopening his factory in California. Officials finally agreed to let him restart production with safety measures in place.