One of the oldest coal companies in the U.S. said Monday it expects to emerge from bankruptcy in coming weeks after a judge approved a plan that will keep its mines running in Montana, New Mexico and several other states and Canadian provinces.

Westmoreland Coal Co. will keep its name but get new leadership as creditors take control a firm that fell more than $1.4 billion into debt amid declining coal markets.

Rosebud Mine will have new owners under court-approved sales by Westmoreland Coal Co.

Under the agreement, the southeast Montana mine will honor the final months of its contract with Colstrip power plant. The Colorado-based coal company and its creditors had attempted to end its coal-supply agreement with the power plant.

Rosebud Mine is Westmoreland's biggest producer of thermal coal.

The announcement comes as Westmoreland renegotiates its Absaloka Mine payments to the Crow Tribe downward.

The company's Kemmerer Mine in Wyoming is being sold off to Virginia businessman Tom Clarke.

U.S. Bankruptcy Judge David Jones approved the company's reorganization plan Saturday. All jobs at the mines being sold to the creditors — more than 1,000 positions — will be preserved, Westmoreland spokeswoman Jaimee Pavia said.

Based in Colorado, Westmoreland is the fourth major coal company to file for bankruptcy in recent years, joining Peabody Energy Corp., Arch Coal and Alpha Natural Resources. Its creditors included investment firms, banks and hedge funds.

Many power plants that burn coal closed over the past decade as utilities switched to natural gas and renewable energy sources to generate electricity.

Despite the decline, U.S. industries are expected to burn more than 600 million tons of coal this year. The bulk will come from large mines in the Western U.S.

Westmoreland, incorporated in Pennsylvania in 1854, produced 25 million tons of coal in 2017, ranking ninth among U.S coal companies, according to the Energy Information Administration. Westmoreland also has mines in North Dakota, Texas, Alberta and Saskatchewan, and a coal-fired power plant in North Carolina.

Clarke will spend $7.5 million in cash and $207.5 million in promissory notes to buy the Kemmerer mine, which has about 300 employees. The bankruptcy froze pensions for the mine's retirees and will end their health benefits.