(Reuters) - Tesla Inc TSLA.O announced record quarterly car production on Tuesday but warned of major problems with selling cars in China due to new tariffs that would force it to accelerate investment in its factory in Shanghai.

In July, China raised tariffs on imports of U.S. autos to 40 percent amid a worsening trade war with the United States. Tesla said the combination of tariffs and transportation costs was hurting Tesla sales in the world’s biggest electric car market, sending shares down 2 percent to $304.37.

“Taking ocean transport costs and import tariffs into account, Tesla is now operating at a 55 percent to 60 percent cost disadvantage compared to the exact same car locally produced in China,” the company said.

The California-based electric carmaker, emerging from several months of turmoil stemming from its tweeting Chief Executive Elon Musk, said it produced 80,142 vehicles in the third quarter, a 50 percent jump from its prior quarter as the company strives to master volume production.

Tesla has scrambled to get the Model 3 into the hands of customers, many of whom have been waiting since early 2016. Vehicles have piled up in lots around California awaiting transport, and Musk said last month that Tesla had moved from “production hell to delivery logistics hell.”

Tesla delivered 83,500 cars, including 55,840 Model 3 sedans, which topped Wall Street forecasts.

As the quarter drew to a close on Sept. 30, Musk invited Tesla owners to volunteer at delivery centers to help new owners picking up their Model 3s, answering questions and giving vehicle overviews.

FILE PHOTO: A row of new Tesla Model 3 electric vehicles is seen at a parking lot in Richmond, California, U.S., June 22, 2018. REUTERS/Stephen Lam/File Photo

Tesla reduced the number of Model 3s in transit to customers to 15 percent of total Model 3s delivered from 60 percent in the second quarter, a figure watched by analysts as an indicator of future revenue and of Tesla’s efficiency.

But the company in its release did not reiterate Musk’s oft-repeated promise that Tesla would be profitable and cash flow positive in both its third and fourth quarters. Tesla is expected to release quarterly financial results next month.

Musk wrote in an email to employees on Saturday the company was “very close to achieving profitability” but for that it must stabilize a brutal ramp-up in output whose targets it has consistently struggled to meet.

Tesla has been burning cash and holding out the promise that churning out Model 3s at volume and a profit could ease its crunch. The figures announced on Tuesday did not specify profit margins for the new car, although Tesla sold mostly higher-priced variants.

“Bottom line is cash is tight,” wrote Gene Munster, head of research at brokerage Loup Ventures, who estimated that Tesla needs $1.5 billion to sustain operations. It ended the second quarter with about $2.3 billion. “This is a step in the right direction, but more work remains.”

Tesla also is recovering from a fight with U.S. securities regulators over whether Musk misled investors when he tweeted in August that he was considering taking the company private and had secured funding.

Tesla and Musk reached a settlement on Saturday where the billionaire will step down as the company’s chairman but remain as chief executive.

On average, Tesla produced about 4,000 Model 3s per week during the quarter. It first hit a goal of building 5,000 vehicles in a week at the end of June, and had hoped to reach a new target of making 6,000 Model 3s per week by the end of August.

CHINA PLANS

Amid the worsening of President Donald Trump’s trade war with China, Tesla said it was speeding up construction of its Shanghai Gigafactory but provided no details.

Musk in July landed a deal with Chinese authorities to build a new combined auto and battery plant in Shanghai, its first outside the United States and a key to doubling its global capacity. Local debt, he said, would finance the factory, which Tesla estimated would cost about $2 billion.

Tigress Research analyst Ivan Feinseth said Musk “continues to downplay” the need for cash to fund projects beyond the China plant.

“I believe he will need to raise additional money even if he is profitable for this quarter as he as projected,” said Feinseth, citing the cost of the upcoming electric semi-truck and the Model Y SUV.