BP's effort to contain the oil spill in the Gulf of Mexico suffered another setback on Wednesday when a discharge of liquid and gases forced the company to remove the containment cap that for three weeks had been able to capture much of the oil gushing from its damaged well.

Adm. Thad W. Allen of the Coast Guard, at a briefing in Washington, said a remote-controlled submersible operating a mile beneath the surface had most likely bumped a vent and compromised the system. Live video from the sea floor showed oil and gas storming out of the well unrestricted.

By evening, the cap was back on, nestled in place on the eighth try after about 90 minutes of effort. Live video showed remote-controlled submersibles frequently moving hoses out of the way so that the cap could be lowered over the spewing oil.

The company said funneling of oil and gas through a pipe to the drill ship Discoverer Enterprise began shortly after the cap was properly positioned. John Curry, a BP spokesman, said collection would return to full capacity "as conditions permit."

Another system, connected to a drill rig, the Q4000, continued to operate throughout the day, siphoning oil through a separate pipe near the seabed.

The incident was yet another complication in BP's two-month struggle to contain the tens of thousands of barrels of oil spewing into the gulf every day.

On Tuesday, BP said it had been able to capture 16,665 barrels of oil through its containment cap, two-thirds of the total recovery operation. But at 8:45 a.m. local time on Wednesday, workers noticed liquids escaping from a valve connected to the Discoverer Enterprise.

A technician with knowledge of the situation said that gas had apparently flowed up the part of the pipe containing warm water used to prevent the formation of icelike hydrates. Out of concern that more gas might come up, creating the potential for an explosion, the Discoverer Enterprise was moved about 50 feet away, taking the cap with it, said the technician, who spoke on the condition of anonymity because he was not authorized to comment on the work.

Also Wednesday, Admiral Allen said that two people working with the overall response efforts had died. One was the operator of a vessel assisting the cleanup in Gulf Shores, Ala., who was found dead on his docked boat. The other person died in a swimming pool accident. Neither death appeared to be directly related to the people's specific duties in the effort, Admiral Allen said.

Stan Vinson, the coroner in Baldwin County, Ala., said the man found dead on his boat was William A. Kruse, 55, of Foley, Ala. He was a charter boat captain hired by BP. "A single wound to the victim's head appears to be self-inflicted," Mr. Delmore said in a statement.

As oil gushed fiercely from a mile under the surface on Wednesday, some beleaguered fishermen in the gulf received a reprieve. The National Oceanic and Atmospheric Association said it opened a small portion - 8,000 square miles - of previously closed fishing area in the Gulf of Mexico because it had not observed oil in the area. One area, south of Mississippi, had only been closed since Monday.

Two-thirds of the federal waters of the Gulf of Mexico are still open for fishing, and the oceanic agency said the closed area now represented 78,597 square miles.

Still, Florida residents directly experienced the effects of the oil: tar balls and oil mousse (with the consistency of sludge) washed up on the shore of Pensacola Beach and caused several areas for swimming to be closed, said a spokeswoman for the Incident Command in Mobile, Ala.

In Washington, Interior Secretary Ken Salazar said Wednesday that he was preparing new evidence to support a six-month moratorium on deep-water oil and gas drilling in the Gulf of Mexico and was prepared to vigorously challenge a federal judge's ruling on Tuesday that the drilling ban was unjustified.

Appearing before a Senate committee, Mr. Salazar said the "pause" in the drilling of 33 deepwater wells in the gulf was essential until the causes of the April 20 BP Deepwater Horizon explosion and oil leak were fully understood.

A federal judge in New Orleans ruled Tuesday that the moratorium Mr. Salazar imposed in May was not supported by the facts or law and was causing extreme economic distress throughout the Gulf Coast. The Obama administration quickly announced that it would appeal the ruling, and Mr. Salazar promised a new order within days to justify the drilling halt.

But Mr. Salazar left open the possibility that the moratorium could be revised or even lifted for certain types of wells in the gulf before the six months are up.

At the same hearing, the man whom Mr. Salazar and President Obama have designated to oversee reforms of offshore drilling said he planned to create an investigative unit to root out corruption and speed reorganization of the office.

The overseer, Michael R. Bromwich, who was appointed director of the Minerals Management Service last week, said in testimony before the Senate Appropriations Committee that the new investigations team would report directly to him and would work closely with the Interior Department's inspector general's office, which has issued several tough reports on misconduct at the minerals service in the last decade.

Mr. Bromwich, a former inspector general in the Justice Department, said the unit would quickly act on charges against agency officials or the companies they are supposed to regulate.

Also in Washington on Wednesday, the House voted to grant subpoena power to the commission appointed by President Obama to investigate the accident and recommend ways to make offshore drilling safer. The bill, sponsored by Representative Lois Capps, Democrat of California, passed by a vote of 420 to 1.