NEW ORLEANS  BP said Thursday that it had capped its hemorrhaging well, at least temporarily, marking the first time in 86 days that oil was not gushing into the Gulf of Mexico.

Oil stopped flowing around 2:25 p.m. when the last of several valves was closed on a cap at the top of the well, said Kent Wells, a senior vice president for BP.

The announcement came after a series of failed attempts to cap or contain the runaway well that tested the nation’s patience. Mr. Wells emphasized that pressure tests were being conducted to determine the status of the well, which is now sealed like a soda bottle. BP and the government could decide to allow the oil to flow again and try to collect all of it; they could allow the oil to flow and, if tests show the well can withstand the pressure from the cap, close the well during hurricanes; or they could leave the well closed permanently.

The last option seems unlikely, but whatever the decision, the cap is an interim measure until a relief well can plug the leak for good.