Tesla Inc. shares rallied after Elon Musk struck an upbeat tone about demand for the company’s vehicles and its ability to navigate a potential economic downturn. 

Shares leapt nearly 11% to $160.27 a share in Thursday trading and are up 30% year to date. The stock is bouncing back after suffering its worst performance ever last year and is on pace for its largest monthly percent increase since July 2022. It was the best performer in the S&P 500 on Thursday.

“Thus far, in January, we’ve seen the strongest orders year-to-date than ever in our history,” Mr. Musk said on an earnings call with investors after the Wednesday market close. “We are currently seeing orders that are almost twice the rate of production.”

The EV maker’s poor stock performance in 2022 came as interest rates rose, competition grew and its brand popularity diminished. But recent price cuts for certain vehicles coupled with mixed results in the fourth quarter helped lift investor sentiment.

Tesla posted a profit of nearly $3.7 billion and sales of $24.3 billion for the final three months of 2022. Both figures, while growing, came in below analysts’ estimates. 

The Austin, Texas-based company also said it planned on 1.8 million vehicles for the year without specifying whether that was a production or a delivery target. A delivery target of 1.8 million would mark 37% growth from 2022 and come in below Wall Street’s expectations; the company has been aiming to increase vehicle deliveries by an average of 50% annually. 

Analysts largely zeroed in on margins as the vehicle price cuts are expected to dent Tesla’s profitability. 

“We are forecasting only a [720,000] increase in deliveries and therefore expect 2023 auto gross profits to fall [year over year],” said Wells Fargo analysts Colin Langan and Kosta Tasoulis. They also forecast a 19.3% margin, below Tesla’s target of 20%.  

Still, the Inflation Reduction Act and boosted production at the company’s Berlin and Texas sites are expected to help Tesla’s margins, analysts said.

“While in the near-term Tesla is sacrificing margins for higher volumes, we view this as the right strategic poker move to put an iron fence around its customer base and fend off growing EV competition coming from Detroit, Europe, and China,” said Wedbush analysts Dan Ives and John Katsingris. 

The gap between Tesla and auto makers working to catch up in the EV space may not change soon, especially given the price cuts. Mr. Musk said the price change could attract more of the “average consumer” as customers’ purchasing power gives way to inflation.

Demand will be tested as economic uncertainty remains, analysts say. “While Tesla is not necessarily insulated from a downturn, we believe it should be much more resilient in a recession globally given the cost levers at its disposal,” said analysts at Deutsche Bank.

Write to Denny Jacob at denny.jacob@wsj.com