Tesla's Chief Executive Elon Musk had fired off a series of posts on Twitter railing against an unequal playing field in China, which limits foreign ownership of Chinese ventures and imposes steep tariffs on imported cars.

The outburst raised questions over whether Tesla's ongoing talks to build a manufacturing facility in China, the world's largest auto market, had been shelved amid growing trade tensions between the United States and China.

The Shanghai government, however, said communication with Tesla had always been positive and the two sides "had a shared goal" to propel the development of China's new-energy vehicle market, referring to full-electric and plug-in hybrid cars.

"Both sides will keep looking thoroughly at plans in China. Currently the details are still under discussion, once anything is confirmed we will announce it as quickly as possible," it said in an emailed statement to Reuters.

"As Tesla CEO Elon Musk has said openly before, Tesla attaches great importance to its development and plans in China."

Tesla officials in China did not immediately respond to a request for comment on Tuesday.

The U.S. firm has been pushing hard to build cars in China, but has hit roadblocks in negotiations with local authorities, in part because Musk is keen to keep full control of any local venture. China currently limits foreign ownership to 50 percent.

Last November Musk said he hoped the plant would be operating within three years, but Tesla and the Chinese authorities have yet to announce any agreement.

Musk's tweets last week, directed at U.S. President Donald Trump, had said that rules in China were hindering Tesla's ability to compete in the market. He called on Trump to help get a "fair outcome" in trade agreements.

"The current rules make things very difficult. It's like competing in an Olympic race wearing lead shoes," Musk wrote.

The Tesla CEO did, however, soften his tone in a later tweet, saying "China has already shown a willingness to open their markets and I believe they will do the right thing".

China, which is making a major push towards electric cars, requires foreign automakers to build factories in 50-50 joint ventures with domestic Chinese automakers and does not allow them to establish wholly owned factories.

(Reporting by Adam Jourdan and SHANGHAI newsroom; Additional reporting by Norihiko Shirouzu in BEIJING; Editing by Shri Navaratnam)