Canadian Pacific wants to sell 660 miles of what used to be the Dakota Minnesota and Eastern railroad, mostly in South Dakota, the company said Tuesday. 

Canada’s second-biggest railroad had already shelved plans to build new rail in coal country in northeast Wyoming and southeast Montana, citing weakened U.S. demand for coal.

CP said it will “defer indefinitely plans to extend its rail network” into the Powder River Basin, a swath of land between the Black Hills and the Big Horn Mountains that contains one of the largest coal deposits in the world. The railroad company — Canada’s second-largest — is also taking a loss on $180 million associated with the cost of the project, which never got off the ground. 

The Powder River Basin was one of the key reasons CP bought the DM&E in 2007. It says it will now sell lines west of Tracy, Minn., including lines into Rapid City, S.D., and from there north to Colony, Wyo., or south to Dakota Junction, Neb.

CP will continue to serve customers along the line – mostly grain, ethanol, clay and merchandise companies.

Railroad investors have cooled to the prospect of deep investment in coal as demand shrinks thanks in part to the abundance of natural gas produced by shale oil and gas drilling in the Northeast, North Dakota and Texas. Power plants have converted from coal to natural gas, and rail shipments of coal have fallen sharply in recent months.