Phelps, who won the event at the Athens and Beijing Games, relegated compatriot and world champion Ryan Lochte to silver while Hungary's Laszlo Cseh took bronze.
Phelps led all the way and got his giant hands on the wall first in a time of one minute, 54.27 seconds, just outside Lochte's world record of 1:54.00 that he set last year in the final at the Shanghai world championships.
Lochte, close to exhaustion after winning bronze in the 200 backstroke half an hour before the medley, held on to finish second, just 0.63 behind his team mate. Cseh clocked 1:56.22 for the bronze.
Phelps had joined forces with Lochte on Tuesday to win gold in the 4x200 freestyle relay and claim a record 19th Olympic medal and the 200 individual medley victory on Thursday gave the 27-year-old his 16th Olympic gold medal and 20th overall.
Only two swimmers had ever won the same individual event at three successive Olympics, Australia's Dawn Fraser, in 100 freestyle in 1956, 1960 and 1964, and Hungary's Krisztina Egerszegi in 200 backstroke in 1988, 1992 and 1996.
It is a feat that had eluded generations of the best male swimmers until Phelps, who had the chance of doing it in four different events in London.
He came fourth in the 400 individual medley and looked to set to achieve the feat in his favoured 200 butterfly but was pipped by South Africa's Chad le Clos on the final stroke.
Phelps still has the 100 butterfly to come on his programme, with the American showing no signs of fatigue despite his busy schedule and advancing years to easily win his semi-final in 50.86 seconds.
The race took place less than an hour after the medley final but Phelps was able to catch his breath and qualify fastest for the final.
"He does that better than anyone, doing the second event after the first really hard one," said his coach Bob Bowman.
Phelps won the 100 butterfly gold at the last two Olympics but faces a stiff challenge making it three on the trot.
The finalists include Serbia's Milorad Cavic, who Phelps famously beat by a fingernail in Beijing to win the seventh of his eight golds in China.
Phelps will also take on South Africa's Chad le Clos, who has surfaced as his biggest danger after Le Clos beat the American in the 200 final and qualified second fastest for the 100 but he said he did not think he could win the shorter race.
"In tonight's 100m fly (semi-finals) he was a bit tired and made a great time so I think tomorrow night will be a little bit unrealistic to try and win," le Clos said.
"I'm next to him again so that will be another dream for me to swim next to Michael Phelps."
Earlier in the evening Tyler Clary upset his American team mate Lochte to win the men's 200 metres backstroke gold medal.
Lochte led at all the turns but faded on the last lap as Clary drew level with him then got his hands on the wall first in a tight finish to win his first Olympic gold medal a time of one minute, 53.41 seconds.
Japan's Ryosuke Irie, runner-up to Lochte at last year's world championships, also made a late charge to grab the silver while Lochte won the bronze.
- Ryan Lochte
- Michael Phelps