New York CNN Business  — 

Ford shook off the impact of supply chain problems and limited vehicle inventory to post much better-than-expected profits and revenue in the second quarter.

The number more closely watched by investors, its income excluding special items, jumped to $2.7 billion compared to the $510 million it earned on that basis a year earlier. Analysts surveyed by Refinitiv had forecast an increase in those adjusted earnings, but nowhere near as big, with a consensus forecast of $1.9 billion.

Revenue was $40.2 billion, up from the $26.8 billion a year ago. Revenue from vehicle sales rose 57% to $37.9 billion — easily topping the consensus forecast by about $3.6 billion. The revenue jump was far more than the 35% increase in the number of vehicles Ford sold to dealers and distributors worldwide, demonstrating that higher prices helped achieve those results.

The global auto industry has been struggling with supply chain problems, especially a shortage of computer chips, which limited inventories on dealer lots. With demand outpacing supplies, retail car prices hit record levels in recent months.

“We’re moving with purpose and speed into the most promising period for growth in Ford’s history,” said CEO Jim Farley.

Worries remain for automakers, however, and one of them is the growing risk of a recession hitting the pent-up demand for new vehicles. Executives at rival General Motors said Tuesday that while it does not see any signs of an economic downturn, it is preparing for that possibility.

Ford’s earnings statement was far more bullish, affirming its full-year earnings guidance and announcing a 50% increase in its dividend to 15 cents a share.

One piece of bad news in the report was a $2.4 billion charge against its net income due to the drop in value of its investment in electric truck maker Rivian. It followed a $3.1 billion charge it took for the same reason in the first quarter, which turned that quarter’s net income into a net loss. Ford’s holdings in the startup are still worth more than than the $500 million it originally invested, although far less than the value of that investment soon after Rivian’s IPO last fall.

Shares of Ford (F) gained 6% in after-hours trading on the report.