Story highlights An oil pipeline that crosses the Yellowstone River burst near Glendive, Montana

The Yellowstone River is the longest undammed river in the United States

(CNN) A Montana pipeline burst sent as much as 50,400 gallons of oil gushing into the Yellowstone River, prompting the governor to declare a state of emergency.

Residents in nearby cities were told not to drink the tap water, which some said smelled like diesel.

The massive oil spill happened when the 12-inch pipeline, which crosses the Yellowstone River, ruptured Saturday about 5 miles upstream from Glendive, Montana's Department of Environmental Quality said. The Bridger Pipeline company shut down the pipeline.

Glendive City Council member Gerald Reichert was among the residents who noticed a disturbing odor in the drinking water.

"Suddenly at our house there was a definite smell. It was a diesel smell," Reichert told the Grand Forks Herald

Read More