America\'s Ryan Lochte broke a 19-month record drought and deepened Michael Phelps\' season of woe Thursday as he won a thrilling 200m individual medley at the world championships in Shanghai. In a high-tempo evening at Oriental Sports Centre, Australian hotshot James Magnussen delivered a fifth-to-first victory in the 100m freestyle and Jiao Liuyang claimed China\'s fourth swimming gold in the women\'s 200m butterfly. Lochte out-duelled Olympic champion Phelps to win the medley in 1min 54.00sec, shaving one tenth of a second off his 2009 world record, with his team-mate taking silver and Hungary\'s Laszlo Cseh third. With the win, the 26-year-old Lochte retained his world title and earned further bragging rights over his long-time rival, who is struggling to reach the level that has earned him 14 Olympic gold medals. Lochte, 26, also ended a lengthy barren streak which had seen no long-course records broken since super-fast polyurethane swimsuits were banned at the start of last year. \"I knew it was going to be a battle between Michael and I. I got the better end this time,\" Lochte said. \"Any time you break a world record, you\'ve got to be excited. I trained really hard and it paid off.\" Phelps enjoyed a slim early lead over the butterfly leg but Lochte, swimming in the adjacent lane, edged it over the backstroke, breaststroke and freestyle sections to win by 0.16sec. Lochte had already beaten Phelps to win the 200m freestyle title, turning the screws on his out-of-sorts team-mate after he was part of the United States\' relay team that lost its six-year grip on the 4x100m relay on day one. But Phelps stormed back with a dominant win in the 200m butterfly, which is not one of Lochte\'s events, sealing the 23rd world title of his record-breaking career as the clock ticks down to his retirement next year. \"I felt good and I thought I was a little long at the finish, and that cost me the race,\" Phelps said after the medley. I\'m a little disappointed but at the same time it\'s faster than I went in 2008 at the Olympics, so that\'s a good thing. That one frustrated me more than anything. I thought I was going to get that one but it is what it is.\" In the 100m freestyle final, Magnussen was well out of the medals at the turn but he roared past the field over the second 50m to take it in 47.63sec ahead of Canada\'s Brent Hayden and William Meynard of France. Brazilian defending champion and world record-holder Cesar Cielo, who has been in the firing line after testing positive for a banned diuretic, was fourth. In the women\'s 200m butterfly, Jiao led from start to finish to win ahead of Britain\'s Ellen Gandy and world record-holder Liu Zige of China. Australia\'s two-time defending champion Jessicah Schipper was joint last. And Russia\'s Anastasia Zueva won the women\'s 50m backstroke in 27.79sec, ahead of Aya Terakawa of Japan and Aliaksandra Herasimenia of Belarus. Earlier, Olympic title-holder Britta Steffen pulled out of the world championships after struggling in the women\'s 100m freestyle heats, depriving the competition of one of its brightest stars. The double world and Olympic champion withdrew after scraping into the semi-finals with the lowest qualifying time of 54.86sec, nearly two seconds off her 2009 world record of 52.07. \"I gave everything -- I had no more to give,\" she said. \"I can\'t explain it. I was in great shape and very optimistic. I\'m in good health. \"I would give you answers if I had them.\" In Steffen\'s absence, Britain\'s Francesca Halsall timed quickest in the semi-finals, ahead of Dutch swimmer Femke Heemskerk and Australian Alicia Coutts. \"You\'ve always got to save a bit for the final, haven\'t you?\" Halsall said. \"Like we said this morning that was a starter, this is the main course, you got to sweeten it up with the dessert tomorrow night.\"