(Reuters) - Electric car maker Tesla Inc TSLA.O reaffirmed on Sunday it is talking with the Shanghai municipal government to set up a factory in the region and expects to agree on a plan by the end of the year, but declined to comment on a report that a deal has been reached.

FILE PHOTO: Tesla Model 3 cars are seen as Tesla holds an event at the factory handing over its first 30 Model 3 vehicles to employee buyers at the company’s Fremont facility in California, U.S. on July 28, 2017. Courtesy Tesla/Handout via REUTERS

China levies a 25 percent duty on sales of imported vehicles and has not allowed foreign automakers to establish wholly owned factories in the country, the world’s largest auto market. Those are problems for Tesla, which wants to expand its presence in China’s growing electric vehicle market without compromising its independence or intellectual property.

China’s government has considered allowing foreign automakers to set up wholly owned factories in free trade zones in part to encourage more production of electric and hybrid vehicles - which the government calls “new energy vehicles” - to meet ambitious sales quotas.

Tesla would still have to pay a 25 percent duty on cars built in a free trade zone, but it could lower its production costs.

Tesla on Sunday pointed to a statement it made in June that the company “is working with the Shanghai Municipal Government to explore the possibility of establishing a manufacturing facility in the region to serve the Chinese market. As we’ve said before, we expect to more clearly define our plans for production in China by the end of the year.”

A Tesla spokesperson in the United States declined to comment further beyond referring to the June statement.

The Wall Street Journal reported that Tesla and the Shanghai government have reached a deal in that city’s free trade zone. Shanghai is China’s de facto automotive capital and a significant market for luxury vehicles of all kinds.

Chinese internet company Tencent Holdings Ltd0700.HK has a five percent stake in Tesla and is seen as a potential ally for Tesla's efforts to enter the Chinese market.

It was unclear if the Chinese government will conclude a deal with Tesla to coincide with U.S. President Donald Trump’s visit next month.

Tesla Chief Executive Elon Musk has said the company eventually will need vehicle and battery manufacturing centers in Europe and Asia.

Tesla is wrestling with production problems at its sole factory, in Fremont, California. It is trying to accelerate output of its new Model 3 sedan, but conceded earlier this month that production bottlenecks had held third-quarter production to just 260 vehicles, well short of the 1,500 previously planned.