The Keystone pipeline was temporarily shut down on Thursday, after leaking about 210,000 gallons of oil into Marshall County, South Dakota*, during an early-morning spill.

TransCanada, the company which operates the pipeline, said it noticed a loss of pressure in Keystone at about 5:45 a.m. According to a company statement, workers had “completely isolated” the section and “activated emergency procedures” within 15 minutes.

Brian Walsh, a state environmental scientist, told the local station KSFY that TransCanada informed the South Dakota Department of Environment and Natural Resources about the spill by 10:30 a.m.

TransCanada estimates that the pipeline leaked about 5,000 barrels of oil at the site, Walsh said. A barrel holds 42 U.S. gallons of crude oil.

The Keystone pipeline system is nearly 3,000 miles long and links oil fields in Alberta, Canada, to the large crude-trading hubs in Patoka, Illinois, and Cushing, Oklahoma. It was completed in 2011. The entirety of its northern span—which travels through North Dakota, South Dakota, Nebraska, Kansas, Oklahoma, Missouri, and Illinois—would stay closed until the leak was fixed, the company said.

TransCanada said it was still operating the pipeline’s southern span, which connects Oklahoma to export terminals along the Gulf Coast.