U.S. rig company Hercules Offshore said it reached a restructuring agreement that could lead to a reorganization plan or bankruptcy filing in the coming weeks.

"We have reached a restructuring agreement with an overwhelming majority of our senior noteholders that will allow Hercules to substantially reduce its debt burden and secure additional liquidity to help us navigate the current downcycle," President and Chief Executive Officer John Rynd said in a statement.

Hercules, which has headquarters in Houston, posted a first quarter net loss of $57.1 million, compared to net income of $19.9 million during the first quarter of 2014. In its latest statement, the company said it was planning a reorganization or the start of Chapter 11 bankruptcy proceedings "within the next few weeks."

The company in early June said Saudi Aramco withdrew a February notice of termination for rig Hercules 261. The Saudi company reduced the day rates under the terms of its contracts with Hercules to $67,000 per day.

Hercules in its latest quarterly report said it expected the demand for offshore rigs could remain lower for the year amid few signs of a recovery in the oil price market.

The rig company said noteholders would exchange $1.2 billion in shares for 97 percent of new common stocks issued in the reorganization. They also agreed to backstop $450 million of the new capital needed to build a new rig for the company, which Rynd said would put Hercules in a position to benefit from an eventual rebound in offshore drilling activity.

"We expect minimal interruption to our operations as we implement the restructuring contemplated by the agreement," he said.

A weak market for crude oil leaves energy companies with less cash to spend on exploration and production. One of the largest rig services companies in the world, Diamond Offshore Drilling, announced in May it lost $256 million during the first quarter of the year.