HOUSTON — BP and government officials said Friday that a cap installed over a gushing well in the Gulf of Mexico was funneling some oil and gas to the surface, but they cautioned that much was still leaking and that it would be days before they could declare this latest containment effort a success.

As the large metal cap was inched into place late Thursday, about 80 engineers, scientists and government officials crowded into the hive — as the room in the subsea operations command center is called — here to watch on video screens. The maneuver was their handiwork, and a critical step in the latest of what had been a string of dismal efforts to capture some of the oil leaking since the Deepwater Horizon drill rig exploded on April 20.

As the cap hit the oil and gas streaming with great force from the top of the well, it suddenly disappeared, hidden from the video cameras by clouds of hydrocarbons spewing everywhere, said a technician who was there. The operation was briefly flying blind. But a few tense moments later the cap was successfully centered over the wellhead, 5,000 feet below the surface, then lowered half a foot to make a seal. The crowd, including Energy Secretary Steven Chu, gave a cheer.

“I would say that things are going as planned,” Kent Wells, a BP executive, said at a briefing Friday afternoon. “I am encouraged. But remember, we only have 12 hours’ experience.”