WILMINGTON, Del./WASHINGTON, July 6 (Reuters) - Alpha Natural Resources said on Wednesday it expects to reach a deal with the U.S. government over responsibility for the cost of cleaning up mining sites, removing one of the most significant hurdles to the coal company’s exiting bankruptcy.

Over the past few weeks, the fourth-largest U.S. coal miner and a slew of government agencies appeared to be heading for a showdown in court on Thursday, when Alpha is scheduled to ask a federal judge to approve its plan over objections.

At issue is a program called self-bonding that has allowed leading coal companies to forego purchasing cleanup insurance on federal land by pledging to cover any such costs.

Peabody Energy, Arch Coal and Alpha Natural Resources have all gone bankrupt in the last 11 months, leaving behind roughly $3.6 billion in self-bonding liabilities, according to securities filings.

Federal officials have promised to try to shield taxpayers from that cost, but the Obama administration must compete with other creditors for the companies’ scarce assets.

The government called Alpha’s plan “fundamentally flawed” and said it was not prepared in good faith because it skirts environmental obligations, while the company has said the plan is the best way to benefit all parties.

On Wednesday, Alpha said it anticipated reaching a deal by Thursday with the U.S. Department of Interior, Environmental Protection Agency and other agencies, according to a filing in the U.S. Bankruptcy Court in Richmond, Virginia.

Alpha said a deal would include a “funding agreement” between Alpha, its lenders and a new company created to take over Alpha’s best mining assets.

The U.S. Department of Justice, which brought the government’s objections, did not immediately respond to a request for comment.

Peter Morgan, an attorney for the Sierra Club, said the government may have backed off its tough stance because of fear of getting nothing in the event Alpha liquidated.

Alpha filed for bankruptcy in August as coal prices plunged to a 12-year low.

Alpha plans to sell core mining assets to its lenders, who will pay by forgiving what they are owed rather than cash. Alpha has also reached a deal to sell natural gas assets for $200 million in cash.

The reorganized Alpha would continue to own a number of mining complexes primarily in Appalachia, and critics say it will lack funds for clean-up costs. The plan also shields its creators from liability. (Reporting by Tom Hals in Wilmington, Delaware; Editing by James Dalgleish)