For 20 years, Exxon Mobil’s 12-inch Silvertip pipeline lay buried beneath the waters and muddy bottom of the Yellowstone River in Montana, and Friday it was feeding 39 barrels a minute to small refineries in the Billings area.

Then at 10:41 p.m., the pressure in the pipeline dropped — the sign of a leak.

Six minutes later, at the Exxon Mobil control room in Houston, workers used remote devices to shut down the pipeline’s pumps, reducing the flow. A valve near the refinery was closed, reopened, then closed again. Finally, 55 minutes after the pressure drop, the crucial valve on the other side of the river was closed.

Exxon Mobil estimates that in the interim as many as 42,000 gallons of crude oil spilled into the fast-flowing Yellowstone River, which is swollen with melted runoff from heavy winter snowfalls. The river, surging over its banks, snakes its way through Montana into North Dakota and empties into the Missouri River.

Suddenly, images familiar from last summer’s much bigger Gulf of Mexico spill are back: Workers mopping up oil with absorbent pads and laying plastic booms near shorelines. Soiled grasses and breeding grounds. Apologies from a big oil company. And an angry governor.

Montana Gov. Brian Schweitz­er (D), who has a master’s degree in soil science, vowed to “stay on this like smell on a skunk until it’s cleaned up.” He added: “Exxon Mobil? They’re going to pay for it. I promise you this right now. Yellowstone is cleaned up when the state of Montana says it’s cleaned up, not some bureaucrat from Washington or the state of Texas.”

If Exxon’s estimate is correct, this spill would be just a fraction of 1 percent of the size of BP’s spill in the gulf last year. But the company said it had already spread nearly 20 miles, and others said it stretched twice that far. Schweitzer said flooding had carried the oil into eddies and wetlands that he called “the health and wealth of a river.”

Moreover, the spill raises questions far beyond the banks of the Yellowstone River: How can the nation’s 2.3 million miles of aging gas and hazardous-liquid pipelines be safely maintained? Exxon Mobil’s pipeline subsidiary alone has 8,000 miles of lines. Was there sufficient regulatory oversight? And how can a big company make sure that decisions in far-flung corners of its bureaucracy don’t end up causing a disaster?

Exxon now in spotlight

In the wake of the BP spill last year, Exxon Mobil executives said the 1989 Exxon Valdez tanker accident off the coast of Alaska taught them to control risks. Yet environmental groups said Exxon had failed to take measures that might have prevented the Yellowstone River spill.

The Transportation Department’s Pipeline and Hazardous Materials Safety Administration said it is looking into Exxon’s handling of the pipeline shutdown as well as its maintenance of the line’s other river crossings.

This past fall, officials from PHMSA had met with residents from the nearby town of Laurel because people there were worried that flooding from heavy snowmelt could erode the soil above the pipeline and expose it to damage from debris.

In May, Exxon Mobil shut the pipeline for a day and reviewed data collected last year — including soundings from September and December that it said showed five to eight feet of riverbed above the line, said company spokesman Alan T. Jeffers. He said the company was responding to Laurel’s concerns but concluded that the line was safe. PHMSA, however, said Exxon reported 12 feet of cover.

“I was not aware of that shutdown,” said Chris Hoidal, PHMSA’s western regional director for pipeline safety. The company was not required by law to close the line in May. “What led them to shut that down, that is a focus of our investigation,” Hoidal said.

Jeffers also said the company ran an inspection device, known in the industry as a “pig,” through the line in 2009, complying with regulations.

The unfolding spill in Montana could complicate the State Department’s decision about whether to approve the 2,000-mile Trans­Canada Keystone XL pipeline, stretching from Canada’s tar sands to the Gulf Coast. Foes of the project — environmentalists, ranchers, farmers and residents along the proposed route — point to other recent pipeline spills, including a nearly million-gallon spill on the Kalamazoo River last year and several smaller accidents in the United States and Canada.

“The Yellowstone spill makes it clear, yet again, that we have to have a better assessment of pipeline safety in the U.S. before we move ahead with the mother of pipelines in the Keystone XL pipeline,” said Susan Casey-Lefkowitz, who directs the international program at the Natural Resources Defense Council. She said an existing Keystone pipeline has had 12 spills in its first year of operation.

TransCanada spokesman James Millar said that the spills — which ranged from five to 16,800 gallons — came from ground pump stations, not underground lines, and that each was contained within TransCanada’s property.

Spill cleanup

At the Yellowstone River, the president of Exxon Mobil’s pipeline unit, Gary Pruessing, said the company had received complaints of oil deposits from 36 landowners. He said Exxon had brought in 70,000 feet of boom and 3,000 absorbent pads, each 2 by 3 feet. Half the pads had been applied, he said. He said there was no new technology involved, “just hard work.”

Jim Martin, the Environmental Protection Agency’s regional administrator, said the EPA was co­ordinating a team of 440 people seeking “oil and oily waste.” Martin said flooding made some areas impenetrable, making it hard to determine if there is contamination south of Billings.

“There’s a tremendous amount of water moving at a very high velocity,” Martin said in a phone interview. “There are some places we can’t get to.” He added, “We are going to be here for quite a while.”