Canadian Pacific Railway Ltd is rerouting freight traffic, some via other carriers, after flooding on the Canadian Prairies damaged its transcontinental line, a spokesman said.

CP had its tracks between Maple Creek, in southwestern Saskatchewan, and Medicine Hat, in southeastern Alberta, knocked out on Friday by flooding that has also played havoc with farmers and cut the Trans-Canada Highway.

"Everything is getting through with as few delays as possible," spokesman Mike LoVecchio said.

CP was redirecting traffic, which includes grain, cars and consumer goods, onto its own northern line as well over lines in Canada and the United States owned by Canadian National Railway Co , Burlington Northern Santa Fe Corp and Union Pacific Corp.

Local news reports in Medicine Hat said 200 metres (660 feet) of CP's line was washed away, and that quick action by local residents warned the crew of an approaching train to stop before they reached the washout.

"All of a sudden I could see more earth and rubble moving and the next thing you know there was an almighty whoosh and the whole thing collapsed," local resident Raymond John told the Medicine Hat News, describing the washout, which he said left tracks dangling in midair.

Record rainfall has closed roads and swamped houses and businesses in this usually dry region of Canada. (Reuters)