British oil giant BP said Tuesday it could slash capital spending further this year as weaker oil and gas prices continue to drag down earnings.

The company Tuesday reported its second consecutive loss in quarterly earnings. Profits plunged 80 percent to a pretax loss of $485 million in the first three months of 2016, down from a profit of $2.1 billion in the same period last year. Executives blamed the drop on falling commodity prices and continued costs tied to its 2010 oil spill disaster in the Gulf of Mexico.

BP (NYSE:BP) said it took a pretax hit of $917 million in the first quarter related to the fatal Deepwater Horizon rig explosion, a cost that continues to overshadow the company’s broader efforts to curb spending. The disaster has so far cost the company $56.4 billion in legal claims, civil litigation and cleanup expenses.

BP said it slashed capital expenditures to $3.9 billion in the first quarter, compared with $4.4 billion in the same period a year ago. The company now expects to trim total spending for 2016 to $17 billion, or about 10 percent less than the $19 billion it spent in 2015. If oil prices remain at today’s lows, BP said it could slash spending even further in 2017, to between $15 billion and $17 billion.

“Should prices remain low, we have the flexibility to adjust further within the financial framework,” Brian Gilvary, BP’s chief financial officer, said in a statement.

Oil prices tumbled more than 70 percent this winter from a June 2014 peak of $110 a barrel for Brent crude, the global benchmark. Brent averaged $34 a barrel in the first quarter, compared with $54 a barrel in the same period last year. Brent prices have so far averaged $40 a barrel in the second quarter, BP said.

Lower oil prices helped drive BP to its worst annual loss in two decades last year. The company in February reported a loss of $6.5 billion for all of 2015 after slashing capital spending three times and eliminating nearly 10 percent of its 80,000-person workforce.

Bob Dudley, BP’s group chief executive, said that despite the cutbacks, BP was still on track to complete its next wave of upstream oil and gas production projects. He also said he anticipates oil prices could lift in coming months on stronger global demand and declining global oil output.

“Market fundamentals continue to suggest that the combination of robust demand and weak supply growth will move global oil markets closer into balance by the end of the year,” Dudley said in the statement.