David J. Phillip, Associated Press
The United States' Michael Phelps, right, and teammate Garret Weber-Gale celebrate winning the gold in the men's 4x100-meter freestyle relay final in Beijing.

BEIJING — By a fingertip, Michael Phelps is still on course for eight gold medals. He can thank Jason Lezak for getting him No. 2.

The oldest man on the U.S. swimming team pulled off one of the great comebacks in Olympic history this morning, lunging to the wall just ahead of France's Alain Bernard in a race so fast it actually erased two world records.

Wow!

Few sporting events live up the hype — this one exceeded it. The 32-year-old Lezak was nearly a body length behind the massive Bernard as they made the final turn, but the American hugged the lane rope, drafting off the Frenchman and stunningly overtaking him on the very last stroke.

Watching on deck, Phelps let out a resounding "Yeaaaaaah!" and thrust both arms toward the roof of the Water Cube. His quest to break Mark Spitz's record of seven gold medals had survived what will likely be its toughest test.

The Americans shattered the world record set by their "B" team the previous evening in the preliminaries, touching with a time of 3 minute, 8.24 seconds — nearly 4 full seconds below the 15-hour-old mark of 3:12.23.

"I was going nuts," Phelps, who swam the leadoff leg and then became the team's biggest cheerleader, told NBC. "As soon as (Lezak) came off that last wall, I started going crazy. We're a team. We went in as a team and now we're exiting as a team — and we're going out with that gold that we needed to get back."

The Americans won the 400 free relay at seven straight Olympics, but watched the Australians and South Africans take gold at the last two games.

"I've been on the last two relays where we come up short," Lezak said. "To be honest with you I got really tired of losing."

Bernard was the world record holder in the 100, but he lost that mark as well. Australia's Eamon Sullivan broke the individual record by swimming the leadoff leg in 47.24 — ahead of Bernard's mark of 47.50.

While the Americans whooped it up on deck, Bernard clung to the wall, his head down. The swimmer who had talked confidently of beating the Americans was the last one to leave the pool.

The French were second in 3:08.32 — eight one-hundredths of a second behind. Australia took the bronze in 3:09.91. In fact, the top five all went below the record set Sunday.

Katie Hoff knows exactly how bummed the French are.

She built a big lead in the 400 freestyle, but touched 0.07 after Britain's Rebecca Adlington. After two of her five individual races, Hoff has a silver and a bronze — the amount she expected, but not necessarily the right color.

With Christine Magnuson taking silver in the 100-meter butterfly, the United States regained the lead and some breathing room over China in the overall medals race.

In other action at the Water Cube today, Magnuson finished behind Australia's Libby Trickett; American Brendan Hansen had the agony of finishing fourth in the 100-meter backstroke and the added disappointed of losing his world record to winner Japan's Kosuke Kitajima; and Kirsty Coventry of Zimbabwe set a world record in the 100-meter backstroke semifinals, taking down the mark set this summer by American Natalie Coughlin.

In the men's 400-meter freestyle, reigning world champion Park Tae-hwan of South Korea won the gold, Zhang Lin of China took silver and Jensen was third; at least Jensen can take solace in setting a U.S. record, breaking the mark he set in qualifying the night before. Favored Aussie Grant Hackett of Australia wilted from first to sixth.