Occidental Petroleum Corp., the fourth-largest U.S. oil producer, swung to a significant net loss for the third quarter on Wednesday as it booked charges for dropping futures prices and halted projects while saying it was exiting North Dakota.

The company, which also has operations in the Middle East and Colombia, showed a net loss of $2.61 billion, or $3.42 per share, in the third quarter ended Sept. 30, compared with a profit of $1.21 billion, or $1.55 per share, in the year-ago quarter.

The result reflects the tough times a more than 50 percent drop in crude prices over the last year has wrought on oil companies.

Charges it took “reflect the sharp decline in the oil and gas futures price curves, as well as projects that management determined it would cease to pursue,” Occidental said in a statement.

On an adjusted basis, Occidental was able to beat expectations as it lifted output from a year earlier and slashed costs to offset tumbling prices.

Houston-based Occidental slashed its capital budget by $300 million in the quarter, and Chief Executive Steve Chazen said the company has “made a strategic decision to exit” the Bakken, which had drained resources away from Occidental’s core Texan shale fields.

Reuters reported this month that Occidental had sold its North Dakota assets to private equity fund Lime Rock Resources. It was the most significant pullback by a big company from the Bakken fields of North Dakota since the downturn started.

Excluding one-time items, the company earned 3 cents per share.

By that measure, analysts expected a loss of a penny per share, according to Thomson Reuters.

Average daily production rose 16 percent to 689,000 barrels of oil equivalent (BOE) from the year-ago quarter, even as the average price Occidental received for its oil fell 49 percent to $47.78 per barrel.

Shares of Occidental rose 2.4 percent to $71.90 as U.S. oil prices rose more than 3 percent to $44.50 a barrel.