By Dave Sebastian

Chevron Corp. posted steep losses in the second quarter as lower oil and gas prices sapped production gains and the decimation in global travel amid the Covid-19 pandemic crimped fuel demand.

The oil giant, based in San Ramon, Calif., on Friday posted a second-quarter loss of $8.27 billion, or $4.44 a share, compared with a profit of $4.31 billion, or $2.27 a share, in the comparable quarter last year.

Adjusted losses were $1.59 a share. Analysts polled by FactSet were expecting adjusted losses of 93 cents a share.

The company said it booked impairments and other charges of $1.8 billion for the quarter to account for downward revisions in its commodity-price outlook, severance charges of $780 million and a gain of $310 million on the sale of Azerbaijan assets. Chevron also impaired its $2.6 billion in investment in Venezuela due to the operating environment's uncertainty, it said. Chevron's peers, such as BP PLC, Hess Corp. and Occidental Petroleum Corp., have taken multibillion-dollar impairments amid the pandemic-induced economic slowdown.

Revenue fell 65.3% to $13.49 billion from the year-ago period. Analysts were looking for $21.87 billion.

"The past few months have presented unique challenges," said Michael Wirth, Chevron's chairman and chief executive. "The economic impact of the response to Covid-19 significantly reduced demand for our products and lowered commodity prices."

Production was 2.99 million barrels of oil-equivalent a day, down from 3.08 million a day a year earlier, the company said.

Although demand and commodity prices have shown signs of recovery, Chevron said they aren't back to pre-Covid levels. The company warned its results could continue to be depressed through the third quarter.

The company earlier in July agreed to buy Noble Energy Inc. for about $5 billion, injecting the first signs of life in energy-sector deal-making in what would be the largest oil-path tie-up since the pandemic delivered a shock to the industry. Buying the company would expand Chevron's presence in the DJ Basin of Colorado and Permian Basin, which spans West Texas and New Mexico. Chevron also said the acquisition would yield it potential annual cost savings of $300 million.

Write to Dave Sebastian at dave.sebastian@wsj.com