By Kimberly Chin

Kinder Morgan Inc. swung to a loss in the fiscal second quarter as the company contends with a significant curb in demand due to the Covid-19 pandemic.

"Sharp declines in crude oil and natural gas production along with reduced demand for refined products due to the economic shutdown in the wake of the pandemic clearly affected our business and will continue to do so in the near term," President Kim Dang said in prepared remarks.

The pipeline operator posted a quarterly loss of $637 million, or 28 cents a share, compared with a profit of $518 million, or 23 cents a share, in the comparable period a year ago. Adjusted earnings were 17 cents a share. Analysts polled by FactSet expected adjusted earnings of 23 cents a share.

Kinder Morgan attributed the loss to a $1 billion impairment of goodwill related to its natural gas midstream business as it saw a steep decline in natural gas production.

Revenue fell to $2.56 billion from $3.21 billion a year earlier. Analysts were expecting $3.9 billion in revenue.

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