(Bloomberg) -- Tesla Inc. is close to a preliminary deal to set up a factory in Indonesia, according to people familiar with the matter, as Elon Musk’s electric-vehicle maker looks to capitalize on the Southeast Asian nation’s reserves of key battery metals.

The plant would produce as many as 1 million cars a year, the people said, in line with Tesla’s ambition for all its factories globally to eventually reach that capacity. The discussions include plans for multiple facilities in the country serving different functions, including production and supply chain, one of the people said. A deal hasn’t been signed and the agreement could still fall through, said the people, asking not to be identified as the talks are confidential.

Tesla shares rose 2.3% as of 9:55 a.m. New York time Wednesday. The stock plunged 65% last year.

Musk and representatives for Tesla didn’t immediately respond to an email seeking comment. Indonesian Investment Minister Bahlil Lahadalia said talks with Tesla are being led by the coordinating ministry for maritime affairs and investment when asked about the potential deal on Wednesday. A representative for the ministry didn’t immediately respond to requests for comment.

Indonesia has long courted Tesla. President Joko Widodo visited Musk in May of last year and and struck a $5 billion nickel-supply agreement with the carmaker in August. In an interview that month with Bloomberg News, Widodo said he wanted Tesla to make electric cars in the country, not just batteries, and was willing to take the time to convince Musk to see Indonesia as more than just a supplier of key resources.

Read more: Jokowi Says Tesla Must Make Cars Locally, Not Just Batteries

An Indonesian factory would be at least the third Tesla plant outside its home US market, joining facilities in Shanghai and near Berlin. While Indonesia offers a gateway to Southeast Asia’s 675 million consumers, it’s a tough market for global automakers, with cars priced below $20,000 making up the bulk of sales.

During Tesla’s annual shareholder meeting in August, Musk said he expects the company will eventually build 10 to 12 factories globally. The carmaker also was in talks late last year to build an EV assembly plant in Mexico, Bloomberg reported last month. It’s scheduled an investor day to discuss expansions plans on March 1.

Tesla appears to be plowing ahead with plans to add capacity despite missing estimates for vehicle deliveries each of the last three quarters and producing about 60,400 more cars than it handed over to customers during that span. The company cut prices in China for the second time in 10 weeks earlier this month.

--With assistance from Debby Wu.

(Updates with shares trading in the third paragraph.)

©2023 Bloomberg L.P.