GLENDIVE, Mont. (AP) — Sonar indicates part of an underground pipeline that spilled almost 40,000 gallons of oil into Montana’s Yellowstone River and fouled a local water supply is exposed on the riverbed.

The pipeline is exposed for about 50 feet near where the breach occurred Jan. 17, according to a news release from public agencies involved with the response.

The pipeline had been buried at least 8 feet under the riverbed, and the depth was last confirmed in September 2011.

The cause of the spill remains under investigation. It prompted a five-day shutdown of drinking water services for 6,000 people in the city of Glendive after oil got into a treatment plant.

Prior accidents, including a 2011 Exxon Mobil pipeline spill on the Yellowstone near Billings, have demonstrated that pipelines beneath bodies of water can quickly become exposed by floodwaters or other natural forces.

Bridger Pipeline Co., which is based in Casper, Wyoming, says its pipeline will remain shut down from Glendive to near the Canada border until the river section is replaced. The company says the pipeline will be buried deeper beneath the river.

Federal rules require lines to be buried at least 4 feet beneath riverbeds.

The 193-mile Poplar Pipeline delivers crude from the Bakken oil patch of North Dakota and Montana to a terminal in Baker, Montana, about 55 miles south of Glendive. It was built in the 1950s and has a capacity of 42,000 barrels of oil a day.

The Yellowstone River is a popular recreation destination and home to fish, including the endangered pallid sturgeon.

Copyright 2015 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.