By Micah Maidenberg

Duke Energy Corp. reported a second-quarter loss after the utility and a partner stopped trying to build the Atlantic Coast Pipeline and Duke reported lower volumes due to the Covid-19 pandemic.

Duke on Monday said it lost $817 million, or $1.13 a share, down from a profit of $820 million, or $1.12 a share, for the second quarter last year.

Last month, Duke and Dominion Energy Inc. said they would abandon the proposed $8 billion Atlantic Coast Pipeline, which was meant to move natural gas some 600 miles through West Virginia, Virginia and North Carolina.

Dominion said then it would sell the rest of its gas transmission and storage unit to Warren Buffett's Berkshire Hathaway Inc. for $9.7 billion including debt.

Duke said expenses related to its stake in the pipeline totaled $1.63 billion for the second quarter.

Excluding those costs, the company reported an adjusted profit of $1.08 a share, 5 cents more than forecasts from analysts, according to FactSet.

Operating revenue fell to $5.42 billion, lower than the consensus estimate of $5.85 billion, from $5.87 billion year over year.

Commercial and industrial customers used less power in the quarter, Duke said, weighing on volumes.

Duke said its cost-savings measures saved $170 million, offsetting "lower volumes and higher costs related to the pandemic."

Write to Micah Maidenberg at micah.maidenberg@wsj.com