The night before, Michael Phelps stood by the pool with a strained smile and a bronze medal, his quest for Olympic immortality dashed, his million-dollar bonus lost, his gold medal count stuck on one.

But when you are 19 and a glorious swimmer, a lot can happen in a day.

Tuesday night the Maryland aquatic sensation was back on the top podium at the main Olympic pool here, his gold-medal meter suddenly up to three, and the excitement of victory back on his face.

Phelps pulled in the two top medals via a close individual race and a thrilling relay final.

He first swam a controlled, and surprisingly tense, contest in the 200-meter butterfly, eking out a win over the fast-closing Japanese swimmer Takashi Yamamoto.

Phelps finished in 1 minute 54.04 seconds, just off his world record time of 1:53.93. Yamamoto's time was 1:54.56.

An hour later, Phelps was part of the American team's rousing victory over the defending champion Australians in the 4x200-meter freestyle relay.

The winning time of 7:07.33 was only .13 of a second faster than the Australians, who hold the world record of 7:04.66, but it was enough for a new American record.

For Phelps, who started the race for the Americans, the triumph brought him to new heights of jubilation as he watched teammate Klete Keller, swimming the anchor leg, edge out Australian superstar Ian Thorpe.

"As soon as [Keller] hit that wall, we all just went crazy," Phelps said. "I don't think I've ever celebrated like that in my entire life."

Indeed, Phelps, Keller, 22, Ryan Lochte, 20, and Peter Vanderkaay, 20, who swam the middle legs of the race, yelled, pumped their arms in the air and joined in a delirious group hug on the pool deck after the race.

Lochte and Vanderkaay had raced superbly in the morning heats, helping to grab the best qualifying time and landing the Americans the coveted lane four in the middle of the pool for the final.

Phelps's two new gold medals, from five events he has raced in the Games so far, go with the one he took Saturday in the 400-meter individual medley.

Phelps had been shooting for seven or even eight gold medals in Athens, but bronze in the 400 freestyle relay Sunday and bronze in the 200-meter freestyle Monday eliminated those chances.

He stood to win a $1 million corporate bonus if he matched Mark Spitz's record of seven gold medals in 1972. But Phelps said Tuesday that some of the pressure on him had departed, along with the bonus.

He has two more individual events this week: the 200 individual medley -- in which he holds the world record -- and the 100 butterfly, against teammate and world record holder Ian Crocker.

Phelps also is likely to swim in the heats or the final of the 400 medley relay near the end of the week.

He has a good chance at getting gold medals in all three events, for a total of six.

Tuesday's relay was extremely dramatic. The American men, distressed by their poor showing in the 400 freestyle relay Sunday and by other disappointing performances, badly wanted to win the 800.

"Australia had owned that event for seven years," Phelps said breathlessly right after the race. "It was a goal of ours to come in here and prove something."

Phelps began the race by grinding out a lead of about a second over the leadoff Australian, Grant Hackett. Lochte and Vanderkaay improved the margin. But seconds into the final lap, Thorpe, the world record holder in the 200 freestyle, had closed on Keller and seemed poised to take over.

But the towering Australian seemed to flag near the end and Keller would not be caught.

"This race tonight will go down in history," Phelps said.

Eddie Reese, the coach of the U.S. men's team, praised Phelps after the race.

"Michael can lead off a relay, or anchor," Reese said. "He can do anything."

He noted that Phelps had raced the butterfly, attended the gold medal ceremony and then had to prepare for the relay in a short period of time.

"He just goes out there and when the gun goes off he gives it everything he's got," Reese said. "We're not sure what makes him tick. . . . He does things nobody can do. He just keeps going. . . . He just goes forever."

The result came in the wake of the U.S. team's stunning loss Sunday night in the 400 freestyle relay, in which Phelps and three other elite American swimmers finished behind South Africa and the Netherlands.

It was only the second time in Olympic history that the U.S. had lost the race, and the only time ever it had finished third. Both Phelps and Reese said the team had been badly shaken by the loss.

But Tuesday night was different. Phelps's coach, Bob Bowman, said after the relay, "This one's really good."

Michael Phelps celebrates his gold medal in the 200-meter butterfly, one day after he lost a chance at a $1 million bonus. He also won gold in the 4x200 freestyle relay.