Noble Corp., Freeport-McMoRan Oil & Gas LLC (FMOG) and Freeport-McMoRan Inc. (Freeport), FMOGs parent company, have reached an agreement to end the contracts for drillships Noble Sam Croft and Noble Tom Madden with “operations ceasing as soon as practicable,” a news release said.

The contracts were scheduled to end in July and November 2017, respectively.

As a result, Freeport will pay Noble $540 million—payable through a combination of cash, Freeport shares and up to $200 million in near-term Noble bonds.

In addition, Noble can receive additional contingent payments from Freeport of $25 million and $50 million, respectively, depending on the average price of oil over a 12-month period, according to the release. Noble also expects to realize over $100 million in direct cost savings as a result of the contract terminations through crew reductions and stacking procedures.

As disclosed in Freeport’s public filings, FMOG has substantial debt and has been negatively impacted by the crash in oil prices.

“By accelerating the contract value and removing counterparty risk and potential downtime exposure over the remaining term of the contracts, Noble will be able to secure the economic benefit of these contracts, particularly when factoring in the significant cost savings available,” Noble Corp. CEO David W. Williams said in the release. “Given the financial headwinds facing our client, we are pleased to have resolved this matter in this manner, thus protecting our margins, monetizing the remaining term under the contracts and increasing our already robust financial flexibility.”