Michael Phelps (L) and Ryan Lochte of the US look on after the men's 200m freestyle final at the 14th FINA World Championships in Shanghai. – Reuters SHANGHAI – Michael Phelps kept telling everyone he wasn't in shape at the world championships. Winning seven medals, including four golds, didn't change his mind. What Phelps didn't do – and Ryan Lochte did – was most telling. Lochte beat Phelps in both of their matchups and he set the first world record since high-tech bodysuits were banned 19 months ago while winning five golds and a bronze over eight days at the Oriental Sports Center. Their ongoing rivalry promises to make things interesting on the road to next year's London Olympics. “I don't really think I'm the top dog,” Lochte said. No doubt Phelps will be there waiting for him. “This is 2011, it's not 2012 and it's not the Olympic Games,” Phelps said. “I've been able to gather more motivation here than I already had.” Both Phelps and Lochte earned gold medals Sunday, when the United States won two other golds and six medals total on the final night. China's Sun Yang broke the second world record of the meet, taking down Australian Grant Hackett's 10-year-old mark in the 1,500 freestyle. The American team claimed 29 swimming medals – 16 gold, five silver and eight bronze – to greatly improve upon its performance from two years ago in Rome. Swimming the butterfly leg, Phelps rallied the Americans from fourth to second before Nathan Adrian held off fast-closing Australian James Magnussen to win the medley relay in 3 minutes, 32.06 seconds. Australia took the silver in 3:32.26 and Germany got the bronze in 3:32.60. Lochte wasn't included on the US squad for the final relay because he'd raced the grueling 400 IM, winning in 4:07.13 – a whopping 4.85 seconds ahead of teammate Tyler Clary, who took silver. Yuya Horihata of Japan earned bronze. He also won the 200 IM and 200 freestyle – beating Phelps in both – and the 200 backstroke, along with a gold in the 800 free relay and a bronze in the 400 free relay. Lochte's world record came against Phelps in the 200 IM, an effort he called his best moment of the meet. Phelps pronounced himself “fairly satisfied” with his performance, knowing it was the result of training seriously for just the last eight months. The United States also had strong performances during the week from Jessica Hardy, Elizabeth Beisel and 16-year-old Missy Franklin, who won three gold medals. In the diving competition, China finally bagged an elusive 10 out of 10 gold medals, capping a decade of dominance – and despite the retirement of “diving queen” Guo Jingjing. Russia's “dream team” swept all seven golds in synchronized swimming, led by undisputed “synchro queen” Natalia Ishchenko, who bagged six golds.