Tesla Inc on Wednesday reported a higher-than-expected quarterly profit as a string of price increases on its best-selling electric vehicles helped offset production challenges caused by COVID-19 lockdowns in China.

The company promised a "record-breaking second half" to the year and reiterated its goal of 50% average annual growth in vehicle deliveries over a multi-year horizon, but did not give specific targets for 2022 deliveries in results materials.

Chief Executive Elon Musk on a conference call said the company did not have a demand problem, dismissing the idea that global economic problems had an effect on interest in Teslas.

Shares of Tesla were up about 1% in the after-hours trade. The shares are down about 40% since their peak in November.

Tesla's China factory ended the second quarter with a record monthly production level, and the company said production continued to grow in Texas and that its new German factory saw strong production rate improvement toward the end of the quarter.

Still, Tesla did not give a detailed production outlook for its factories in Berlin and Texas, which Musk had previously said were losing billions of dollars.

"We are prepared for near-term margin headwinds due to (new) challenges with ramping new production, particularly in Berlin," Morgan Stanley said in a report after the earnings announcement.

The EV maker posted an adjusted profit of $2.27 per share versus analysts' consensus estimates of $1.81.

Its automotive gross margin fell to 27.9%, down from a year earlier and the preceding quarter, amid inflationary pressure.

The company has raised prices of its cars several times this year to cope with higher costs of lithium used in batteries and aluminum used for the body, along with other raw materials.

Musk has said, however, that Tesla would drop prices when inflation cools.

"Tesla's solid quarter is the latest sign that it has done an outstanding job navigating through global supply chain and logistics challenges, weathering the storm better than most legacy automakers," said Jesse Cohen, senior analyst at Investing.com

"Tesla's improved manufacturing efficiency places it in a good position to produce more cars, putting it on track to break its deliveries target for the year," he said.

BITCOIN

Tesla said it has converted approximately 75% of its bitcoin purchases into fiat currency, which added $936 million of cash to its balance sheet. Musk at the start of a conference call with analysts said the sale was made to increase liquidity when Tesla was uncertain about how long the COVID-19 lockdown in China would continue. Tesla had not sold any of its holdings of the Dogecoin cryptocurrency, he added.

"It’s unclear exactly how much the group lost to the sell-off in crypto, but with 75% of its holding now converted into more stable currency, most of the damage has been recognized," said Laura Hoy, analyst at Hargreaves Lansdown.

"However, the Bitcoin losses point out an important part of the Tesla investment case – its eccentric owner. While Musk’s impressive innovation has served the company well, his personal flair is starting to raise governance questions," she added.

Total revenue fell to $16.93 billion in the second quarter from $18.76 billion a quarter earlier, ending its streak of posting record revenue in recent quarters, as it struggled to meet demand for its electric cars due to a shutdown of its Shanghai factory and production challenges at new plants.

Analysts were expecting revenue of $17.10 billion, according to IBES data from Refinitiv.

Tesla is bracing for a potential recession and mounting competition from rivals. It also faces challenges of significantly boosting production in the second half, after China's lockdowns hit production of the company and its suppliers.

Musk previously said Tesla's new factories in Texas and Berlin were struggling to boost production, calling them "gigantic money furnaces" which were losing billions of dollars.

Musk said he had "a super bad feeling about the economy" in June and began layoffs.

(Reporting by Hyunjoo Jin in San Francisco and Nivedita Balu in Bengaluru Editing by Anil D'Silva, Peter Henderson and Matthew Lewis)