Michael Phelps's quest for seven Olympic gold medals, a million-dollar bonus prize and a place in sports history ended Monday night in a heart-stopping race in which the Maryland teenager placed a close, but definitive, third behind two of the most illustrious athletes in swimming.

The widely anticipated men's 200-meter freestyle final at the packed Olympic pool went to the black bodysuit-clad Australian giant Ian Thorpe, the world record holder in the event, who touched out speedy Dutchman Pieter van den Hoogenband. Phelps hit the wall less than a blink of an eye later.

Thorpe set an Olympic record, finishing in 1 minute 44.71 seconds. Van den Hoogenband was second in 1:45.23. Phelps posted a time of 1:45.32, an American record.

In his three events, Phelps has won one gold medal and two bronze, a pretty good haul for any 19-year-old Olympian. Originally, however, the Baltimore County native and his handlers had set their sights on Mark Spitz's historic seven gold medals at the Munich Games in 1972.

Phelps made the best of his third-place finish, saying he had tested himself against the world's best. "How can I be disappointed?" he said at a news conference. "I swam in a field with the two fastest freestylers of all time and I was right there with them. I'm extremely happy with that. It's a [personal] best time. It's a new American record."

"I wanted to race those guys and that's what I did," he said. "It was fun."

Asked about the Spitz record, Phelps said: "I had an opportunity and I tried to do something that he did and I tried to match that but I didn't . . . I guess you could say a little bit of pressure's off."

The result cost Phelps the $1 million bonus that Speedo, his chief sponsor, was offering if he could win seven gold medals. Now the best he can do is win six. But even if he falls short of that lofty achievement he already has endorsement deals with Speedo and several other companies worth millions.

And Speedo's million-dollar bonus offer for matching Spitz extends to the Beijing Games in 2008, when Phelps will be 23, an age when most male swimmers are entering their prime.

Phelps has yet to swim in three other individual races and two relays in Athens.

After the freestyle final, Phelps, Thorpe and van den Hoogenband strode arm-in-arm around the pool bearing flowers and adorned in the head wreaths of victory.

"I don't think Michael Phelps is an emerging swimmer anymore," said Thorpe, who prior to the Games had predicted Phelps would be unable to match Spitz's record. "Get that clear."

Most Olympic forecasters said that winning eight or even seven gold medals would be highly unlikely, and Phelps's coach, Bob Bowman, expressed fears that his swimmer would be considered a failure if he fell short.

But Phelps didn't care, Bowman said Monday. The swimmer sought out the 200 freestyle, knowing that he would be an underdog and that one of his gold medals might be threatened.

The matchup turned out to be the premier race of the Olympics so far. It pitted the high-profile, teenaged American media sensation against Thorpe, 22, and van den Hoogenband, 26, both of whom are glamorous, wildly popular in their countries, and the reigning superstars of swimming.

Entering the race, Thorpe held the world record in the event of 1:44.06. Van den Hoogenband held the Olympic record of 1:45.35. Phelps held the American record of 1:45.99.

Van den Hoogenband had stunned Thorpe in 2000, winning the race at the Olympics in Sydney, Thorpe's home town.

Phelps said Speedo's million had been in the back of his mind. "It definitely was," he said. "But there are more opportunities down the road."

Phelps's agent, Peter Carlisle, who helped come up with the idea for the million-dollar bonus, said Monday night that the seven gold medal target "was never a quest of his, just a possibility."

"His quest was to swim his best and that quest lives on," Carlisle said.

A few minutes after the 200-meter freestyle Phelps competed in a semifinal race of the 200-meter butterfly, in which he holds the world record, and finished second.

The final is Tuesday night, and is followed an hour later by another tough matchup, the final of the 800-meter freestyle relay. That race will likely pit Phelps and Thorpe against each other again.

"We're all very excited about that race," Phelps said. "We've been improving a lot over the last four years in that race . . . Australia had been extremely dominant. I will say we want to go out and we want to try to win the gold medal."

Phelps had announced at the U.S. Olympic swimming trials in July that he wanted to swim against Thorpe in the 200 freestyle, saying later he wanted a matchup against the great Australian while both of them were in their prime.

Thorpe and Phelps had exchanged words over the seven gold medals. On July 6 Thorpe said, "I don't think anyone's going to win seven gold medals at the Olympics."

Phelps responded the same day: "Spitz did it . . . I'm at least going to try."

Phelps opened his eight day Olympic program last Saturday with a world-record victory in the 400-meter individual medley. He was disappointed Sunday when the U.S. team finished third in the 400-meter freestyle. He is likely to swim every day through the end of the swimming competition this Saturday.

Australia's Ian Thorpe, who said in July that no one would win 7 gold medals, celebrates his victory in the 200-meter freestyle in an Olympic record 1 minute 44.71 seconds. "A little bit of pressure is off," said Michael Phelps.Bronze medalist Michael Phelps, from right, gold medalist Ian Thorpe of Australia, silver medalist Pieter van den Hoogenband of the Netherlands during their medal ceremony.