Canadian Pacific Railway Ltd reopened a rail line in western Minnesota, after a mile-long train hauling crude oil from Canada derailed in the area, spilling up to 30,000 gallons of oil.

Recovery efforts were expected to take 2-3 days, officials said, after 14 cars on a 94-car Canadian Pacific train heading for the Chicago area left the tracks about 150 miles northwest of Minneapolis near the town of Parkers Prairie.

The spill came as a debate rages over the environmental risks of transporting Alberta tar sands crude from Canada across the border. This was the first spill since the start of a boom in North American crude-by-rail transport began three years ago.

"The rail line has been formally re-opened, following full track repairs and mandatory inspections," Canadian Pacific spokesman Ed Greenberg said in an email.

An investigation into the cause of the derailment is ongoing, he said.

Greenberg said he did not know if the crude was from the Alberta tar sands or from conventional oil fields.

Minnesota Pollution Control Agency spokesman Dan Olson said up to three tank cars were ruptured and an estimated 20,000 to 30,000 gallons - or 475 to 715 barrels - leaked out.

It was unclear how much crude, which leaked into a nearby ditch and field, had been recovered from the site, Olson said.

"The site remains stable and the weather is good for recovery efforts," he said. "It is expected to take 2-3 days to get the crude off the ground." (Reuters)