The buyer is Genesee & Wyoming Inc., which operates short-line and regional freight railways in the United States, Australia, Canada, the Netherlands and Belgium.
As a result of the transaction, CP is expected to record a net after-tax writedown of about $240 million in its fourth-quarter 2013 financial statements. The sale is expected to be cash positive for the Calgary-based railway and have no material effect on future earnings.
The part of the DM&E railway being sold covers about 1,062 kilometres, mostly in Minnesota and South Dakota, with connections into Wyoming and Nebraska.
G&W will rename the line the Rapid City, Pierre & Eastern Railroad and will hire some 180 employees, most of whom will have already been working on the line. It will be able to link up to the networks of CP and other major North American railways.
Canadian Pacific will continue to own and operate about 3,000 kilometres of former DM&E track to the east following the sale.
"There is a strong long-term franchise here and we are pleased to have found a partner in Genesee & Wyoming, which will maintain a high standard of customer service," said CEO Hunter Harrison.
"South Dakota remains an important economic driver in the Midwest and CP looks forward to working with G&W."
The deal is expected to close by the middle of 2014, provided it receives approval from the U.S. Surface Transportation Board and meets other conditions.
Canadian Pacific acquired DM&E in 2008. Part of the line was put up for sale in December 2012 as Harrison announced a raft of big strategic changes.
Harrison took the top job at CP in mid-2012 following a bruising proxy fight that led to the ouster of his predecessor, Fred Green. The activist investor who pushed for the management shakeup, Pershing Square Capital Management's Bill Ackman, had called CP's DM&E purchase a mistake.