This article was reported by Sarah Lyall, Clifford Krauss and Jad Mouawad and written by Ms. Lyall.

Hurricane Dennis had already come and gone on July 11, 2005, when a passing ship spotted a shocking sight in the Gulf of Mexico: Thunder Horse, BP’s hulking $1 billion oil platform, was listing precariously to one side, looking for all the world as if it were about to sink.

Towering 15 stories above the water’s surface, Thunder Horse was meant to be the company’s crowning glory, the embodiment of its bold gamble to outpace its competitors in finding and exploiting the vast reserves of oil beneath the waters of the gulf.

Instead, the rig, which was supposed to produce about 20 percent of the gulf’s oil output, became a symbol of BP’s hubris. A valve installed backward had caused the vessel to flood during the hurricane, jeopardizing the project before any oil had even been pumped. Other problems, discovered later, included a welding job so shoddy that it left underwater pipelines brittle and full of cracks.

“It could have been catastrophic,” said Gordon A. Aaker Jr., a senior engineering consultant on the project. “You would have lost a lot of oil a mile down before you would have even known. It could have been a helluva spill — much like the Deepwater Horizon.”