Ryan Lochte not only beat Michael Phelps in consecutive races — he's taken swimming to record-setting levels.

The laid-back American edged Phelps for gold in the 200-metre individual medley at the world championships Thursday in Shanghai, setting the first world record since high-tech bodysuits were banned at the start of last year.

With Phelps putting pressure on in the final freestyle lap, Lochte sprinted to the wall and touched in one minute 54.00 seconds — improving on his old mark of 1:54.10 set at the last worlds in Rome two years ago when polyurethane suits were still in use.

"I wanted to do something that everyone thought was impossible," Lochte said. "Since they banned those suits, everyone thought a world record would never get touched again. I just wanted to show everyone that can happen. That's why we have records — they're meant to get broken.

"Hopefully everyone now can start realizing that, 'Hey it's possible,' so hopefully a lot more records will fall."

Phelps settled for silver in 1:54.16 and Laszlo Cseh of Hungary took bronze in 1:57.69.

"That one frustrated me more than anything," Phelps said. "I thought I was going to get that one."

Meanwhile, Australian James Magnussen won the 100 freestyle — swimming's signature event — by edging Brent Hayden of Mission, B.C.

Already dubbed the "The Missile" by Australian media, Magnussen took the lead from defending champion Cesar Cielo after 50 metres and touched in 47.63 seconds. Hayden finished in 47.95 seconds.

"It feels awesome," said Hayden. "I came into these championships really hungry for a medal."

At the 2008 Beijing Olympics, Cseh took silver between Phelps and Lochte in both the 200 and 400 IMs. That gives him some perspective on how Lochte gained the upper hand.

"I think without Michael, he can't beat the world record," Cseh said. "He needs Michael to swim together and race against each other, and I think this is a good thing."

Lochte also beat Phelps in the 200 freestyle in the opening individual event Tuesday. Lochte has two more events and Phelps one, although they will not go head-to-head again.

Phelps, who came into this meet with just six months of training, reached out and shook hands with Lochte at the finish.

"He's really done all the little small things right," Phelps said. "He has more comfortable speed now than he had before. He's super focused. He's just more prepared. Things are always won by people who are most prepared. … To go faster than he did in 2009 is incredible."

Lochte also set two world records at the short-course worlds in Dubai in December, the only other individual marks set over the last 19 months, although swimming prefers to measure itself in the 50-metre Olympic-sized pool.

A record 43 marks fell at the 2009 worlds, and with only three more days remaining, it was starting look like this meet might end without a single record. But Lochte changed that, and produced an uncharacteristic celebration, pumping his fist and waving to the crowd when he emerged from the pool as coloured lights flashed inside the Oriental Sports Center.

"Anytime you break a world record, you got to be excited," the Floridian said. "I trained hard and it paid off."

In the 100 free, Hayden took silver and William Meynard of France grabbed the bronze in 48.00. Cielo, the Brazilian who was cleared of doping last week by the Court of Arbitration for Sport, finished fourth.

Competing in his first world meet, the 20-year-old Magnussen created a buzz with his sizzling opening split of 47.49 against Phelps in the 4x100 relay on the meet's opening night Sunday, setting up Australia for gold.

"It means the world and I know it means a lot to Australian swimming as well," Magnussen said. "First person to win that event at a world championships from Australia, which is a pretty big deal. I think it puts men's sprinting in Australia back in the spotlight."

The women's 200 fly was won by Jiao Liuyang of China in 2:05.55, with Ellen Gandy of Britain second and Liu Zige of China, the defending champion and world record holder, third. Jiao took silver behind Liu at the Beijing Olympics.

In a non-Olympic event, Anastasia Zueva of Russia won the women's 50 backstroke in 27.79, with Aya Terakawa of Japan second and 16-year-old Missy Franklin of the United States third.

Franklin then swam a strong leadoff leg when the Americans claimed gold in the 4x200 relay, clocking 7:46.14. Australia claimed silver and defending champion China settled for bronze.

Britain's Francesca Halsall led the women's 100 free semifinals in 53.48. Less than an hour after his record swim, Lochte was back in the water for the 200 back semifinals, which he led in 1:55.65 — far off Aaron Peirsol's world record of 1:51.92.