Samson Resources Corp., one of the largest energy companies to seek bankruptcy in the current commodities slump, reached a new agreement with creditors that aims to bring the company out of Chapter 11 under the ownership of its second-lien lenders.

Tulsa, Okla.-based Samson has struggled to find a path out of its year-old bankruptcy due to weak energy prices and drawn-out battles with junior unsecured creditors.

Under the restructuring support agreement, sketched out in an Aug. 26 filing with the U.S. Bankruptcy Court in Wilmington, Del., a senior bank facility of $942 million will be repaid in full. The reorganized Samson will exit bankruptcy owned by holders of the company's $1 billion second-lien loan, in return for reducing what those creditors are owed.

Holders of $2.3 billion in junior unsecured bonds would receive the proceeds from the sale of unsecured assets and the settlement of certain legal claims. Samson did not estimate the value of those sales and claims.

Samson has been testing the market for its assets, which include oil-and-gas operations in the middle of the continent from Texas to North Dakota. Samson suspended drilling new wells before filing for bankruptcy.

The latest agreement has the support of holders of 39% of Samson's second-lien loan, a group that includes funds affiliated with Silver Point Capital, Invesco Ltd., Franklin Templeton Investments and Cerberus Capital Management, according to court documents.

Samson said in the documents that a new plan would be filed shortly based on the agreement. The plan would need the support of a majority of the second-lien lenders and would need to be approved by U.S. Bankruptcy Judge Christopher Sontchi.

The agreement follows a plan in May in which Samson had proposed emerging from bankruptcy under the control of the banks that hold its loan facility.

The company's junior unsecured creditors have argued that Samson is surrendering valuable legal claims related to a 2011 buyout that was led by KKR & Co. and valued at $7.2 billion. It was one of the largest deals at the time for a shale-focused energy producer.

The unsecured creditors have asked the judge to allow them to file their own plan of reorganization.