Apache Corp. on Aug. 6 reported a nearly $6 billion quarterly loss as a slump in oil prices led the U.S. energy company to write down the value of some assets.

Total oil and gas output averaged 564,000 barrels oil equivalent per day, down 4% from a year earlier.

Growing inventories and worries about demand from China and other countries have prompted a more than 50% slide in crude prices from a year earlier, a decline that has affected the book value of Apache's oil and gas properties and cut into cash flows.

The Houston company posted a second-quarter loss of $5.6 billion, or $14.83 a share, compared with a year-earlier profit of $505 million, or $1.31 per share.

Excluding a $3.7 billion writedown of assets and other one-time items, Apache had a per-share profit of 22 cents.

Analysts on average had expected a loss of 26 cents per share, according to Thomson Reuters I/B/E/S.

Apache, which previously announced a 60 percent decrease in 2015 capital expenditures, said it was raising the low end of its spending forecast to $3.6 billion from $3.4 billion. It kept the high end at $3.9 billion.