“Eastern Montana is the energy producer for the state,” said Jerry Jimison, Glendive’s mayor. “People down here deserve the same safeguards for safe water.”

Glendive, near the North Dakota border, sits on the edge of the Bakken Formation, one of the nation’s richest oil-producing regions, where oil and gas production during the past decade has been a boon to the economies of dozens of small, formerly forlorn prairie towns in North Dakota and eastern Montana.

Unemployment has fallen to 2.2 percent, according to the latest federal data, and an increase in home sales and local tax revenues is linked to the money pouring in from the oil fields and related industries.

On Tuesday, residents complained that they had not been properly notified by either Bridger or local officials about the spill and the subsequent contamination of the treatment plant. Some people said they had learned about it via Facebook posts from other residents.

“I’m O.K. with the pipeline,” said Tracey Rod, who works in the local court system. “It’s what’s making jobs around here.”

But, she added, “I think the city should have told us more and the city should have been quicker.”

Some restaurants and other businesses that rely on city water decided to shut down. Some parents were planning to keep their children home from school, Ms. Kjelstrup said, even though school officials tried to reassure parents that they had plenty of bottled water for cooking and drinking.

Lana Warner was serving coffee and lattes at Crazy Woman Espresso, using purified water that she buys outside Glendive. But she said she could not make frozen drinks — ice was off-limits — and could not wash blenders or dishes using tap water. On Tuesday morning, she said, she washed her hands and immediately noticed a petroleum odor. She decided there was no way she would drink — or serve — anything using municipal water for now.