New York CNN Business  — 

Ford returned to profitability in a big way Wednesday, as strong demand for its trucks led to a much larger profit than Wall Street was forecasting.

The company earned $2.6 billion excluding special items, nearly double the $1.4 billion it earned on that basis a year earlier. And it was far above the $932 million profit that analysts had forecast for the quarter.

The company, along with other automakers, had posted losses in the first half of this year as the Covid-19 pandemic caused shutdowns of auto plants and cut deeply into car sales across the globe. Ford’s net loss excluding items stood at $2.3 billion for the first six months of 2020.

Sales rebounded strongly in the third quarter, though not quite to the levels reported a year ago, as the number of vehicles Ford sold to dealers worldwide fell 5% to 1.18 million compared to a year ago. But automotive revenue at the company still managed to increase 2% to $37 billion, due to strong pricing for the vehicles it did sell. The improved pricing added $900 million to the company’s bottom line.

The results are a sign of a rebound in the auto industry overall.

Shares of Ford (F), along with rivals General Motors and Fiat Chrysler (FCAU), are all up more than 25% since the beginning of June. Earlier Wednesday, Fiat Chrysler (FCAU) reported record earnings.

All three automotive stocks lost ground in Wednesday’s broader market sell-off on worries of increasing Covid-19 cases. But Ford’s results lifted its shares more than 6% in after-hours trading, and gave a boost to GM (GM) shares as well. GM (GM) is due to report results next week.

Ford warned Wednesday that it will be in for more difficult results in the fourth quarter, perhaps even a loss when measured on an earnings before interest and taxes (EBIT) basis.

The headwinds include ramping up production of a new version of the F-150 pickup, the best-selling vehicle in the US market, as well as higher costs associated with the coming launches of the Mustang Mach-E and Bronco Sport, and lower earnings from Ford Credit. The company did say it should be profitable for the full year on an EBIT basis.

But even that warning did little to discourage investors excited by the much-better-than-expected earnings.