(Bloomberg) -- Elon Musk’s private jet has departed Shanghai, wrapping up his first visit to China since the pandemic and topping a whirlwind trip that included a flurry of meetings with senior government officials and a late-night visit to Tesla Inc.’s Shanghai Gigafactory.

At the appearance, around midnight, Musk was shown prototypes of a revamped Model 3, Tesla’s first mass-market sedan. The updated car is slightly longer and sportier than the earlier version and has a sleeker interior design, Bloomberg reported last month. However trial production is yet to start and any public debut is some time off.

Nocturnal factory event over, the billionaire’s plane took off from Shanghai’s Hongqiao airport around 11:22 a.m. local time Thursday bound for Texas, flight tracking website Umetrip showed. 

Read more: Musk Meets China Government Officials on Second Day of Trip 

Musk’s China visit started on Tuesday in Beijing, where he met Foreign Minister Qin Gang and emphasized the importance of maintaining ties with China. He also met with the president of battery giant Contemporary Amperex Technology Co. Ltd., Yuqun Zeng on Tuesday, according to photos posted on social media.

On Wednesday, he met Jin Zhuanglong, China’s minister for industry and information technology, and visited the Ministry of Commerce, accompanied by Tom Zhu, Tesla’s senior vice president of automotive, and Grace Tao, Tesla’s vice president in charge of government and public affairs in Greater China.

Another engagement saw him sit down with China’s Vice Premier Ding Xuexiang, according to a Reuters report, marking the first time Ding is known to have had a one-on-one meeting with a foreign CEO.

He was also photographed at Peking duck restaurant, 1949-Duck de Chine.  

Musk then flew to Shanghai, where he paid the late night visit to the Tesla plant, greeting around 100 employees. He treated them to hamburgers and soft drinks and left about an hour later, according to people familiar with the matter who asked not to be identified discussing private matters.

In a video released by Tesla’s China team on Thursday, Musk was shown waving to the workers, then thanking them for being at the factory so late at night. He also congratulated the staff on their “amazing work” and commented upon how they were able to overcome difficulties and challenges. 

“It warms my heart,” said Musk, making a love-heart gesture with his hands. “Cars produced here are not just the most efficient production, but also the highest quality.”

Tesla has enjoyed significant support from China’s central government as the first wholly-owned foreign carmaker in the nation, as well as the from Shanghai authorities, such as access to cheap land and expedited planning approvals. City officials even provided the EV maker with masks and protective equipment at the start of the pandemic. During the most recent lockdown, authorities helped Tesla secure an old military camp to house workers so it could restart production under a closed-loop system.

The Shanghai plant accounted for more than half of Tesla’s global production in 2022, and the facility can now produce as many as 1.1 million cars a year. In return, the US automaker contributed almost one-quarter of Shanghai’s total automotive production value last year, and local authorities pledged last month to continue to boost ties with the company through autonomous driving and robot modules.

(Updates with Musk and Vice Premier Ding Xuexiang meeting in 6th paragraph.)

©2023 Bloomberg L.P.