China's Tencent Holdings has bought a 5% stake in US electric car maker Tesla for $1.78 billion.

This marks the latest investment by a Chinese internet company in the potentially lucrative market for self-driving vehicles and related services. 

Tencent's investment provides Tesla with a deep-pocketed ally as it prepares to launch its mass-market Model 3. 

Tencent also could help the US company sell - or even build - cars in China, the world's largest auto market, analysts said.

Tesla chief executive Elon Musk tweeted: "Glad to have Tencent as an investor and adviser to Tesla." 

Musk did not say what he meant by "adviser" but in a separate tweet he noted Tesla had "very few" Model 3 orders from China, where the car has not been formally introduced. 

The midsize Model 3 is due to go on sale later this year in the US. 

The deal expands Tencent's presence in an emerging investment sector that includes self-driving electric cars.

This could enable such new modes of transportation as automated car-sharing and delivery services, as well as ancillary services ranging from infotainment to e-commerce. 

Those new technologies, and their potential to create new business models and revenue streams in the global transportation sector, have attracted billions in investment from China's three tech giants - Tencent, Alibaba Group Holding and Baidu. 

The White House did not immediately respond to a request for comment on the Chinese investment in Tesla, but President Donald Trump has been critical of US car makers and of China trade policies. 

Founded in 1998 by entrepreneur Ma Huateng, Tencent is one of Asia's largest tech companies, best known for its WeChat mobile messaging app. 

With a market capitalisation of about $275 billion, it is roughly six times the size of 14-year-old Tesla, whose $45 billion market cap yesterday was only $1 billion shy of 114-year-old Ford. 

As Tesla is doing, many of the start-up companies backed by Tencent, Baidu and Alibaba are developing self-driving systems that eventually could be introduced in commercial ride-sharing fleets in the US and China after 2020. 

Tencent maintains a US office in Palo Alto, in the heart of California's Silicon Valley. Beijing-based Baidu and Hangzhou-based Alibaba also have offices in Silicon Valley.  

Tencent owns about 8.2 million shares in Tesla, the carmaker said. 

To help fund Model 3 production, Tesla raised about $1.2 billion by selling common shares and convertible debt earlier this month. 

Tencent said its shares were acquired as part of the early March equity sale and on the open market.