Washington, DC CNN Business  — 

Ford reported Thursday that its revenues fell 50% in the second quarter, but it posted a profit due to Volkswagen’s investment in its self-driving vehicle program, Argo AI.

Ford (F) announced a net income of $1.1 billion in the second three months of the year, aided by a $3.5 billion gain from VW’s investment. Ford (F) and VW now own equal stakes in Argo AI, which has said it will deploy its self-driving technology in 2022.

Without the investment, Ford would have lost $1.9 billion, which it said was more than $3 billion better than it projected. Automakers have reported slumping sales during the Covid-19 pandemic. Ford stock increased by nearly 1% in after-hours trading following the news.

Ford has focused on stockpiling cash and cutting costs during the pandemic. The automaker says it has more than $39 billion in cash at the end of the quarter.

“I could not be prouder,” Ford CEO Jim Hackett said in a statement. “We delivered a strong [second quarter] while keeping each other safe, caring for customers and neighbors, and assuring tomorrow.”

Ford expects it will turn a profit in the third quarter of the year, but anticipates it will post a loss for the entire year.

Hackett discussed electric vehicles on a call with analysts and said that Ford doesn’t need to build its own batteries because the supply chain has ramped up.

“There’s plenty there that does not warrant us to migrate our capital into owning our own factory,” he said. “There’s no advantage in the ownership in terms of cost or sourcing.”

Ford said that its North American plants ended June at about 95% of their pre-pandemic production levels. Ford’s European plants were back in operation by May 4, according to the company.