Canadian Pacific said Monday it has 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.

Railroad investors have cooled to the prospect of deep investment in coal and CP is being realistic, said Dave Fellon, president of Progressive Rail, a short line owner and operator based in Lakeville.

Demand for coal is shrinking 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.

"When you do an investment like that, you've got to be looking out 20 years, and I don't know that there's the stability for that right now," Fellon said. "They're smart people at CP. They've got good intelligence on markets."

Coal rail traffic is down 10.5 percent this year, according to the Association of American Railroads. Shipments of petroleum products, by contrast, have risen 44 percent.

Union Pacific and BNSF already have a joint rail line into northeast Wyoming, the nation's leading coal-producing state. Canadian Pacific, whose U.S. headquarters are in downtown Minneapolis, paid $1.5 billion for the Dakota Minnesota & Eastern railroad in 2007 to get access to the Powder River Basin.

The deal included contingent payments of up to $1 billion — $350 million if construction were to start on the basin expansion by 2025, and at least $700 million triggered by the specific volumes of coal moving out of the basin.

The railroad announced Monday it will write down the value on the option it paid to build 260 miles of railroad into the basin. Components of the charge include the option itself, engineering design costs, land and capitalized interest. The option is worth less now, and with volume of coal by rail in the U.S. falling sharply, CP is unlikely to exercise it.

"All in, the investment was going to be several billion dollars," said Brian Yarbrough, a railroad analyst for Edward Jones. "It would be almost impossible for them to justify the investment now."

Yarbrough said the scuttling of the Powder River plan raises the possibility CP could sell some of the 2,500 miles of track that make up the Dakota Minnesota & Eastern railway, including what used to be the Iowa Chicago and Eastern railroad. The rail lines cover South Dakota, southern Minnesota, Iowa, and a line from Chicago to Kansas City. Canadian Pacific spokesman Ed Greenberg said the railroad is conducting "a complete review" of all its lines.

The scuttling of the Powder River project, at least for the foreseeable future, puts an end to a persistent dispute in Rochester, where the Mayo Clinic has fought to keep carloads of coal from passing near the clinic.

CP's coal traffic from Wyoming and Montana would have run 100 feet from the clinic. Officials in Rochester even discussed building a railroad bypass south of town.