HOUSTON—A Halliburton Co. engineer warned BP PLC five days before its disastrous Gulf of Mexico blowout that a crucial cement seal inside its well might fail, the engineer told a federal panel investigating the disaster Tuesday.

The engineer, Jesse Gagliano, said he told BP officials in Houston on April 15 that there was a "high probability" of explosive natural gas flowing through the cement unless they made changes. But BP ignored his warnings, he said.

Halliburton technical advisor Jesse Gagliano is sworn in during the Deepwater Horizon joint investigation hearings by the U.S. Coast Guard and the Interior Department's Bureau of Ocean Management Regulation and Enforcement in Houston, Tuesday. Melissa Phillip/Associated Press

Investigators and other experts have identified the possible failure of cement as a likely cause of the April 20 disaster, which killed 11 people and set off the worst offshore oil spill in U.S. history. Cement is meant to block gas and oil from flowing into a well, the first step toward a blowout.

BP hired Halliburton to design and perform the cement jobs on its well and has suggested that the company bears at least some of the blame for the blowout.

But Halliburton said that it showed BP computer models predicting that the well would have a "severe gas flow problem" unless BP used more centralizers, devices meant to hold steel pipe in the middle of the hole.

Mr. Gagliano went further in testimony Tuesday before a joint panel of the Coast Guard and the Interior Department, saying that after he ran the computer model on April 15, he pulled aside BP engineers in Houston and explained the problem to them. He said that he and two BP engineers spent the rest of the day studying the problem, and that by the end of the day, BP had arranged to fly more centralizers out to the Deepwater Horizon, the rig drilling the well.

"By the end of the evening we had determined that 21 centralizers would take care of the issue," Mr. Gagliano said.

BP, however, later decided to use just six centralizers, out of fear that using more could cause the pipe to get stuck. "Who cares, it's done, end of story, we'll probably be fine and we'll get a good cement job," one of the BP engineers involved wrote in an April 16 email, adding that BP could later fix the cement if necessary.

Mr. Gagliano said BP never told him of that decision and that he didn't learn of it until April 18, when Halliburton workers aboard the rig told him. He also said that BP didn't follow other Halliburton recommendations, such as flushing out the well with fresh drilling fluid before pumping in cement.

BP has said the design of its well, named Macondo, was safe and met all regulatory requirements. In a statement Tuesday, BP said: "Halliburton was fully aware of the Macondo well's key design features. … If Halliburton had significant concerns about its ability to provide a safe and high-quality cement job in the Macondo well, then it had the responsibility and obligation to refuse to perform the job. To do otherwise would have been morally repugnant."

Asked by investigators why he didn't object more strongly to BP's decision once he learned about it, Mr. Gagliano said that even if the cement job failed, BP could still go back and pump more cement to fix the problem. But BP never ran a test to check on whether the cement job had been successful and Mr. Gagliano conceded that he never recommended one.

Richard Godfrey, an attorney representing BP at the hearings, pointed to emails from Mr. Gagliano and other Halliburton employees saying that the cementing operation had been successful. Mr. Godfrey also showed an April 18 document, signed by Mr. Gagliano, in which Halliburton referred to the design with the smaller number of centralizers as "our recommended procedure for cementing."

Mr. Gagliano said the line was boilerplate language and that he had recommended the greater number of centralizers.

Brian Morel, a BP engineer who helped oversee the cementing operation, was also scheduled to testify Tuesday but declined to appear, citing his right not to incriminate himself. His attorney declined to comment after the hearing.

Write to Ben Casselman at ben.casselman@wsj.com