* Raises prices on Model X, S by 20 pct in China
* Erases price cuts Tesla implemented in May
* Musk to be in Shanghai on Tuesday, Beijing later this week - BBG (Adds details on price increases, Musk visit to China, background on tariffs, changes source)
SHANGHAI, July 10 (Reuters) - U.S. carmaker Tesla Inc has hiked prices on its Model X and S cars by about 20 percent in China, becoming the first automaker to raise prices in the world's largest automotive market in response to a U.S.-China trade war.
The move is also the first indication of how much higher Chinese tariffs on certain U.S. imports will flow through to showroom floors, with other automakers likely to follow suit or shift a greater portion of production to China.
The tariffs will dent margins at Tesla and other automakers who make cars in the United States and ship to China, as they have been increasingly betting on the world's largest automotive market to boost profits.
"Raising the prices is going to hurt sales, but money-losing Tesla has to raise prices because they can't afford to fully absorb the higher costs of the tariffs," CFRA research analyst Efraim Levy said.
"Considering they claim to be capacity-constrained, they should be able to shift sales elsewhere."
For Tesla especially, rapidly burning cash and struggling to turn a profit, China is key. Sales in the country accounted for about 17 percent of its revenue last year.
In May it slashed up to $14,000 off its Model X in China after Beijing announced major tariff cuts for imported automobiles, but the new tariffs have now erased that.
A basic Model S sedan now costs about 849,900 yuan ($128,779) up from 710,579 in May, while a Model X sport-utility vehicle costs about 927,200 yuan now, versus 775,579 yuan in May, according to its website.
China slapped retaliatory tariffs on U.S. car imports in response to U.S. President Donald Trump's move to impose tariffs on $34 billion worth of Chinese goods.
China's tariffs are expected to hurt automakers as well as companies that make industrial components in the United States, and produce soybean, whisky and other agricultural produce.
NEW TESLA PLANT
Tesla's price increases come as it plans to build a factory in Shanghai to serve the Chinese market. The company ships more than 15,000 cars a year to China.
Chief Executive Elon Musk is expected to visit Shanghai on Tuesday, Bloomberg reported, citing people familiar with the plans. Musk will also visit Beijing on Wednesday and Thursday, Bloomberg said, quoting one of the sources.
A Tesla spokeswoman did not respond to a request for comment.
German luxury automaker BMW, which also makes cars in the United States to sell in China, has also flagged that it will raise prices on vehicles it makes in Spartanburg, South Carolina. It said on Friday that it was unable to "completely absorb" the new tariffs.
Daimler AG, another German automaker which imports U.S.-produced cars into China, said in a statement over the weekend that it "aims to maintain a competitive position" in China.
Ford Motor Co said on Thursday it would not hike prices on its imported cars for now, crimping its profit margins.
($1 = 6.5997 Chinese yuan renminbi) (Reporting by Vibhuti Sharma and Sonam Rai in Bengaluru, Brenda Goh and Adam Jourdan in Shanghai, Norihiko Shirouzu in Beijing, and Karishma Singh in Singapore; Additional reporting by Shanghai Newsroom; Writing by Sayantani Ghosh Editing by Anil D'Silva and Stephen Coates)