Updated

Michael Phelps equaled the most hallowed mark in swimming, winning his seventh gold medal at the world championships Sunday with his fifth world record.

Phelps smashed his own standard in the 400-meter individual medley by 2.04 seconds, becoming the most successful swimmer ever at the worlds.

"This is probably one of the best meets I've ever had," he said. "I'm definitely happy with how it turned out."

The 21-year-old American joined countryman Mark Spitz as the only swimmers to win that many golds at a major international meet. Of course, Spitz' achievement came on the sport's grandest stage — the Olympics.

Phelps hopes to equal the feat or go one better at next year's Beijing Games.

"This is definitely the best-case scenario for what we had in mind leading into the [U.S.] trials and Olympics next year," he said.

Buoyed by Phelps' historic performance, the United States won a leading 36 pool medals, including 20 golds — equaling its record haul at the 1978 worlds in Berlin.

Australia was second with 21 medals and nine golds, including five by Libby Lenton.

A Polish swimmer staged the biggest upset of the last night in the grueling 1,500 freestyle, where Aussie Grant Hackett's run of four consecutive titles ended.

Mateusz Sawrymowicz won the gold medal in 14 minutes, 45.94 seconds against the fastest field in history. He perched on the lane rope and waved his arms, urging the Aussie crowd to cheer him.

"It's great to beat Hackett," he said.

Yury Prilukov of Russia took the silver. David Davies of Britain earned the bronze.

Hackett struggled home seventh, ending a disappointing meet for the soon-to-be-married world record holder. He earned a bronze in the 400 free and was seventh in the 800 free.

"Nothing went according to plan," he said.

Katie Hoff looked like a chip off Phelps' block in winning the women's 400 IM. The 18-year-old out of the same North Baltimore club in Maryland state that launched Phelps set a world record of 4:32.89.

"It's my first one," said Hoff, who was part of a world record in the 800 freestyle relay. "I'm still in disbelief."

Hoff won by an even bigger margin than Phelps — 7.25 seconds ahead of Yana Martynova of Russia. Stephanie Rice of Australia settled for bronze.

Just like Phelps, Hoff won the race on the breaststroke portion, when she dipped under world-record pace and opened a huge lead.

Phelps and Hoff accounted for the night's only world records. American swimmers set 11 of the meet's 14 marks.

Phelps never got a chance at an eighth gold in Melbourne after his U.S. teammates were shockingly disqualified in the 400 medley relay preliminaries Sunday morning.

Ian Crocker, who had been in position to derail Phelps in the 100 fly before losing to his rival, dove in too early on an exchange, causing the DQ.

"It definitely wasn't intentional," Phelps said. "Everything can't go perfect. It's all about how you adapt from those things and learn from experiences, learn from mistakes."

Without the heavily favored United States in the medley relay, it was a wide-open race that had the screaming crowd on its feet throughout. Australians Matt Welsh, Brenton Rickard, Andrew Lauterstein and Eamon Sullivan outtouched Japan by 0.23 seconds for the gold. Russia finished third.

Phelps was gracious about Crocker's gaffe.

"When Team USA comes into a swim meet, we come as a team and we exit as a team," he said. "There are things that don't happen exactly as we want it to, but it's better to happen now than next year."

Still, Phelps closed out his eight-day run in style, winning the 400 IM in 4:06.22 — easily improving his old standard of 4:08.26 set at the 2004 Athens Olympics.

"Being a second or more under my best time in a few events is sort of something that shocked me a little bit," he said.

Ryan Lochte took the silver — a whopping 3.52 seconds behind his teammate — for his fifth medal of the meet. Luca Marin of Italy earned the bronze.

Phelps and Lochte dueled through much of the 400 IM. Phelps was under world-record pace after 150 meters of butterfly. Lochte narrowly took over the lead at 200 meters during the backstroke, his specialty.

But Phelps roared back on breaststroke, again dipping under record pace.

He went 1.49 seconds lower on the first of his two freestyle laps before powering home with the red line that indicates the world-record pace lapping at his feet.

Phelps checked his time and leaned heavily on the lane rope, holding up his right index finger in the No. 1 sign.

Phelps' five world records equaled the number he broke at the 2003 worlds in Barcelona. Back then, he won six medals, including four gold.

As Phelps soaked in the applause during his victory stroll, Crocker looked on pensively from the stands, chewing gum.

Lenton won the women's 50 freestyle in 24.53 seconds. American Natalie Coughlin was last, closing out a five-medal showing, including two golds.

The evening opened with finals in two non-Olympic events — the men's 50 backstroke and women's 50 breaststroke.

Gerhard Zandberg of South Africa won the men's race. American Jessica Hardy took the women's title, upsetting Leisel Jones of Australia, who won the 100 and 200 breaststrokes.