Offshore driller Seadrill Ltd. (SDRL) - Get Report has filed for Chapter 11 after striking a deal with its banks and a minority of bondholders to inject $1 billion of new capital and extend or convert into equity some $8 billion of loans.

Under the terms of the agreement, Bermuda-based Seadrill will receive $860 million in secured loans and a further $200 million from the sale of new equity. At the same time, bank lenders agreed to defer maturities on all secured credit facilities, totaling $5.7 billion, until 2020 and have re-written debt covenants. Seadrill will also ask unsecured creditors to convert $2.3 billion of unsecured bonds and other unsecured claims into a 15% equity stake in the company.

The restructuring agreement won the support of 97% of bank lenders and 40% of bondholders, according to Seadrill.

Seadrill shares were down 3.8% in premarket trading Wednesday, after gaining 17.64% Tuesday to close $0.229. At midday Wednesday, shares traded up 12.81%.

Current shareholders will be all but wiped out by a deal that will leave them with just 2% of the post-restructuring company. Hemen Holding Ltd, owned by Norwegian-born billionaire John Fredriksen and Seadrill's biggest shareholder, has given its support to the deal and agreed to "underpin" the new capital investment.

The prearranged Chapter 11 filing was lodged on Tuesday, Sept. 12, just two days before Seadrill was due to repay a $400 million credit facility on Sept. 14. The agreement concludes more than a year of talks with lenders, which followed a slump in oil prices and a corresponding drop in demand for drilling services that left Seadrill unable to finance the biggest debt burden in the offshore drilling sector.

"The restructuring agreement we signed today is a comprehensive plan that raises over $1 billion of new capita," said Seadrill CEO Anton Dibowitz. "With our improved capital structure, we will be in a strong position to capitalize when the market recovers."

Seadrill said the restructuring would give it a five-year "runway" for drilling activity to recover sufficiently to allow it to meet its new debt agreements. It said the cash injection should enable it to pay all suppliers and vendors in full under normal terms and noted that it already had $1 billion in cash at hand.

Seadrill filed its Chapter 11 petition in federal court in Victoria, Texas. That filing noted Deutsche Bank Trust Co. as its biggest unsecured creditor with $1.74 billion of loans.

Separately, New York-listed Ship Finance International Ltd. (SFL) - Get Report , which leases rigs to Seadrill, said that it had agreed to amend and extend charter hire contracts, cutting 30% off the fee for five-years, with the reduced amount added back in the period after that.

Ship Finance International closed at $13.35 on Tuesday. Shares traded up 4.7% midday Wednesday.

More of What's Trending on TheStreet: