DETROIT (AP) — Ford Motor Co. says it made $3.26 billion in the first quarter, helped by rising vehicle prices and in spite of production cuts due to a global shortage of computer chips.

The earnings reversed a nearly $2 billion net loss from a year ago, when Ford burned through cash at the start of the coronavirus pandemic.

Excluding non-recurring items, the Dearborn, Michigan, automaker says it made 89 cents per share from January through March. That trounced Wall Street estimates of 22 cents per share. Quarterly revenue was $36.23 billion, beating analysts’ estimates of $36.13 billion, according to FactSet.

But the chip shortage could make things worse later in the year. Chief Financial Officer John Lawler said in a statement that Ford expects to lose about half of its second-quarter production due to the shortage. But the second quarter should be the low point for the problem.

The company now expects full-year pretax income to be between $5.5 billion and $6.5 billion, including a $2.5 billion cut due to the chip shortage.

The first-quarter earnings included a noncash gain of $902 million on Ford's investment in electric vehicle startup Rivian.