(Bloomberg) -- The Keystone crude oil pipeline was shut following a spill in North Dakota, the third along the pipeline’s route in less than three years, roiling Canadian and U.S. oil markets.

TC Energy Corp.’s 590,000 barrel-a-day pipeline that carries crude from Alberta to refineries in the U.S. Midwest and Gulf Coast ruptured overnight and caused a spill near the city of Edinburg in North Dakota, Brent Nelson, an emergency manager for Walsh County, said by phone.

TC Energy declared force majeure on the pipeline system after the shutdown, according to people familiar with the matter who asked not to be identified because the information is private. An emergency response team has contained the impacted area, the company said in a statement on its website, adding that it doesn’t have a figure for the volume of oil released. The northern segment of the line will remain shut for investigation, TC Energy said earlier.

The spill comes as TC Energy is seeking to build the controversial Keystone XL pipeline. The company said Keystone was probably the source of a spill in Missouri in February that shut a segment of the line. In 2017, a spill in South Dakota reduced rates on the line for months, causing Canadian oil prices to collapse.

The shutdown threatens to reduce shipments of oil to the key Cushing, Oklahoma, supply hub. Oil prices reacted quickly, with U.S. crude futures recouping some earlier losses, while prices in Alberta weakened.

“If you start to see this situation where flows are reduced for a long period of time, that’s when you’ll see a price impact” on both U.S. futures and Canadian crude prices, Mike Walls, an analyst at Genscape Inc., said by telephone.

Long-Delayed Keystone XL

The spill is estimated to be 1,500 feet in length by 15 feet wide and it has impacted a wetland, the Division of Water Quality within the North Dakota Department of Environmental Quality said in a statement Wednesday. The agency said the volume is currently unknown.

The shutdown comes as U.S. Gulf Coast refineries seek alternative heavy crude supplies amid sanctions on Venezuela, lagging output from Mexico and OPEC production cuts. At the same time, Alberta’s oil producers are struggling to cope with production limits imposed earlier this year when too much oil encountered too few pipelines, causing prices to collapse.

Heavy Western Canadian Select crude’s discount to West Texas Intermediate futures widened $2 to an $18.75 a barrel discount on Wednesday, the widest since last December, data compiled by Bloomberg show. After the Keystone spill in South Dakota in 2017, prices widened from about $11 a barrel to more than $25 a barrel.

The long-delayed Keystone XL oil pipeline has been on the drawing board for a decade. The 1,200-mile (1,900-kilometer) pipeline would help carry 830,000 more barrels of crude a day from Alberta’s oil sands to U.S. Gulf Coast refineries. The project has been a top target of environmentalists, who argue that the pipeline would contribute to catastrophic climate change.

No new export pipelines out of Canada are planned until late next year at the earliest, when Enbridge Inc.’s Line 3 is scheduled to start operation. Two other pipeline projects including the government-owned Trans Mountain line to Vancouver area as well as the proposed Keystone XL have faced regulatory and legal delays in addition to fierce opposition from environmental groups and landowners.

Keystone runs from Hardisty, Alberta, to Steele City, Nebraska, where it splits into two segments running to Cushing and to Patoka, Illinois. From those hubs, oil is transferred to other lines running to the U.S. Gulf Coast, home to about half the nation’s refining capacity.

(Updates with force majeure declaration in third paragraph.)

--With assistance from Michael Bellusci and Sharon Cho.

To contact the reporters on this story: Robert Tuttle in Calgary at rtuttle@bloomberg.net;Sheela Tobben in New York at vtobben@bloomberg.net;Catherine Ngai in New York at cngai16@bloomberg.net

To contact the editors responsible for this story: David Marino at dmarino4@bloomberg.net, Catherine Traywick, Steven Frank

©2019 Bloomberg L.P.