By Kimberly Chin

Capital One Financial Corp. swung to a loss in the fiscal second quarter as the company set aside a higher provision for credit losses due to the Covid-19 pandemic.

The McLean, Va., company recorded a quarterly loss of $918 million, or $2.21 a share, compared with a profit of $1.63 billion, or $3.24 a share. On an adjusted basis, the loss was $1.61 a share. Analysts surveyed by FactSet expected a loss of $2.20 a share, or $2.24 on an adjusted basis.

Capital One boosted its provision for credit losses to $4.25 billion from $1.34 billion in the year-earlier period. It also reported $1.51 billion in net charge-offs.

Total net revenue fell to $6.56 billion from $7.12 billion a year earlier. Analysts targeted $9.22 billion.

Net interest margin, a metric of lending profitability, was 5.78%, compared with 6.8% a year ago.

Write to Kimberly Chin at kimberly.chin@wsj.com

Corrections & Amplifications

This article was corrected on July 28, 2020 because the total net revenue year-ago figure was misstated as $6.96 billion instead of $7.12 billion.