After the coronavirus outbreak caused a nationwide shortage of face masks in January, Chinese officials were quick to ensure that Tesla Inc. wouldn’t be left without.

China’s government helped the U.S. carmaker secure the sought-after supplies that allowed it to reopen at a time when many of its competitors were still shut down. Tesla received 10,000 masks, cases of disinfectant that require a government permit, thermometers and other materials that allowed the company to restart a new factory near Shanghai the first working day after the extended Lunar New Year break, according to state-run media.

The support for Tesla — which also included providing accommodation for some employees as the outbreak snowballed — is emblematic of China’s wider embrace of CEO Elon Musk’s car venture. The tycoon has waged a charm offensive since deciding to build the company’s first plant outside the U.S. in China, home to the world’s biggest EV market, and has been rewarded with the support of officials even as a trade war strains relations with the U.S.

That backing is crucial for Musk’s vision to make China a centerpiece of his automotive ambitions, but also serves a purpose for Beijing, with Tesla’s new factory south of Shanghai a symbol of the government’s efforts to open the economy to global competition and be a world pioneer in EVs.

“Given Tesla’s image of having advanced electric-vehicle technology and expected strong demand for made-in-China Tesla Model 3s this year, no local government anywhere in the world would neglect such a new project,” said Yale Zhang, founder of AutoForesight, a Shanghai-based consultancy.

‘All efforts’

As Beijing pushed local authorities to get the country back to work last month, officials in Lingang singled out Tesla as an example of their success in helping the area’s industry to recover.

The management committee of Lingang “will make all efforts to help key companies including Tesla return to normal production,” Xu Wei, a spokesperson for the Shanghai municipal government, said at a briefing in February. Tesla representatives in China declined to comment on the help it received from authorities.

Tesla has been impacted along with the China’s broader auto industry as the virus prompts customers to stay home, causing a historical plunge in new-vehicle sales. But the support it has received allowed the automaker to recover from a shutdown aimed at slowing the virus’ spread that virtually paralyzed industry in China. A gauge of Chinese manufacturing plunged to a record low in February, according to government data.

Dorms, transportation

Besides the protective materials, Chinese authorities helped arrange dormitories for hundreds of Tesla employees, as well as transport to and from the plant amid the turmoil caused by the outbreak. Shanghai Lingang Human Resources Co., a government-backed agency that coordinates hiring in the area, said it’s helped Tesla add more than 100 new workers since the outbreak, assisting with virus screening and online interviews.

Authorities are also trying to ensure that Tesla’s parts suppliers in China resume production as soon as possible by providing epidemic-prevention materials, Sun Xiaohe, a local official in charge of assisting Tesla, told state media. Catering was also arranged, they reported.

While other automakers such as China’s Zhejiang Geely Holding Group Co. also received masks and other support, the actions to help Tesla have been trumpeted in state media and by local government-backed outlets. Footage of locally-built Model 3 sedans being assembled amid the epidemic have proliferated on TV and online.

Even before the virus, a swift regulatory-approval process enabled Tesla to start deliveries to customers in China in January, a year after it first broke ground on the factory.

“The Gigafactory project illustrated the cooperation between Tesla and the Shanghai government, and that the city has improved its business environment,” Wu Qing, deputy mayor of Shanghai, said at a ceremony that saw Tesla hand over its first China-made car.

Chinese loans

Local banks provided financing for Tesla’s China push, including a $1.6 billion injection announced at the end of last year. The acquisition of land for the plant and a slew of local permits were cleared swiftly, and the plant was hooked to the nation’s power grid quicker than the average for other firms.

As the factory was being planned and local permits pending, Musk visited China often for meetings with everyone from Alibaba Group Holding Ltd. founder Jack Ma to government officials including Transport Minister Li Xiaopeng. He met with Premier Li Keqiang in Zhongnanhai, the leadership compound next to the Forbidden City in central Beijing where the country hosts its most high-profile foreign visitors. Musk was also photographed eating steamed buns, a local delicacy, during a visit to the capital last year.

Soon afterward, Tesla obtained an exemption from China’s 10 percent sales tax on cars. Typically, only EVs made by Chinese companies have been exempt.

“The fact that Tesla received significant government support to overcome the current crisis shows China is delivering its promises to treat foreign firms on equal footing with local ones,” said Ivan Su, an analyst at Morningstar Inc. in Hong Kong.