After failing to medal in the longer version of the race, Michael Phelps got sweet revenge as he beat Ryan Lochte and claimed gold - his 20th Olympic medal - in the 200m individual medley on Thursday evening.

Alarm bells had been set off when Phelps finished outside the medals for the first time in 12 years as Lochte won the 400m IM at the start of the week, before the American finally started picking up medals in the Aquatic Centre to become the most decorated Olympian of all time.

The 27-year-old American had nonetheless failed to win an individual gold in London - but that all changed on Thursday, as he nearly trumped Lochte's world record as he took an early lead and held on down the final length to triumph.

Phelps eventually touched the wall in 1:54.27 - 0.27s behind Lochte's record mark - as his compatriot finished second and Hungary's Laszlo Cseh claimed bronze.

It may be one of the last times we see Phelps in competitive action in an individual event - he has pledged to retire after the Games are over.

The American - who subsequently cruised into the final of the 100m fly - later revealed that he had received a special message from president Barack Obama on Wednesday.

"The president called me yesterday, so that was pretty cool," Phelps said. "He just said how everyone is supporting me and rooting for me, so that was special.

"He tweeted me too, yeah. Ryan and me have had some pretty cool people tweet at us over these few days."

Slightly earlier in the night, there was a surprise as Lochte was beaten in the final of the 200m backstroke by team-mate Tyler Clary.

Clary, who courted controversy prior to the Olympics by suggesting Phelps did not train as hard as perhaps he could, stayed with the heavily fancied Lochte for 150m before overhauling his tired-looking compatriot over the final length, as Japan's Ryosuke Irie also sneaked past Lochte to steal silver.

As for the Brits in action on Thursday, there was disappointment for former world silver medallist Fran Halsall as she finished sixth in the final of the 100m freestyle, won by Dutchwoman Ranomi Kromowidjojo.

Halsall was in contention throughout, missing out on a bronze medal by less than 0.22 seconds - a fact that made the final result doubly frustrating.

"What can you say?" Halsall said afterwards. "I can't change it now - I gave it my best shot. That is all that I could do.

"I thought I had it in me to put in a good race tonight, but the time just wasn't there. At least I've still got the 50m to come - I feel a bit better about the 50 than I do about the 100 at the moment."

Earlier in the night, Lizzie Simmonds booked her place in the final of the 200m backstroke despite finishing fifth in her semi-final. She initially thought that her time of 2:08.48 would not be good enough to qualify, but ultimately she slotted in as seventh fastest qualifier as Missy Franklin and Elizabeth Beisel won the respective heats.

Stephanie Proud suffered heartbreak, however - finding out she was ninth fastest of the semi-finalists and will thus narrowly miss out on Friday's final.

The first final of the evening also saw some history made, as American Rebecca Soni became the first woman to swim under 2:20.00 for the 200m breaststroke.

"That was for my coach Tom because he told me I was going to go 2.19 when I was in high school," Soni said. "He believed in me more than any other coach. As a young kid he was someone I looked up to."