* Phelps adds 20th and 21st gold medals
* Emotional celebration with baby son Boomer
* Hungary's Hosszu takes gold number three
* Ledecky holds off Sjostrom, on track for freestyle treble
By Mark Trevelyan, Alan Baldwin and Amy Tennery
RIO DE JANEIRO, Aug 10 (Reuters) - Michael Phelps won two gold medals on Tuesday, avenging his 200 metres butterfly defeat from the London Olympics and then anchoring the U.S. 4x200 freestyle team to victory on a night of high drama and emotion in the pool.
Katie Ledecky of the United States won her second gold medal of the meeting and Hungary's Katinka Hosszu her third, extending their dominance of women's swimming in feats that on any other day would have grabbed top billing.
Instead it was Phelps, the most successful Olympian of all time, who stole the limelight, extending his career medal tally to 25 by adding golds number 20 and 21.
In the 200 butterfly, he touched the wall in one minute, 53.36 seconds to beat Japan's Masato Sakai by 0.04 seconds, with Hungary's Tamas Kenderesi taking the bronze. Chad Le Clos of South Africa, Phelps' conqueror four years ago, finished fourth.
Phelps, who had announced his retirement after London but launched a comeback in 2014, then celebrated by climbing into the stands to embrace his fiancee Nicole and kiss his baby son Boomer.
Seventy-five minutes after racing, he was back in the water to swim the final leg of the 4x200 freestyle after Conor Dwyer, Townley Haas and Ryan Lochte had built a lead of 1.76 seconds.
The Americans touched in 7:00.66, with Britain second in 7:03.13 and Japan in third after James Guy overhauled Takeshi Matsuda on the final leg.
For Phelps, the butterfly victory was especially sweet after the sting of the London defeat, where he misjudged his final lunge for the wall to let Le Clos steal the gold medal.
"I'm just thankful, that's for sure, I wanted that one back," he said.
"That event was kind of like my bread and butter, and that was the last time I'll ever swim it... There wasn't a shot in hell I was losing it. And if I did, every ounce that I had was left in the pool.
"Just being able to see the number one next to my name again one more time in the 200 fly - I couldn't have scripted it any better."
LEDECKY PUSHED
In the women's races, Ledecky, 19, pipped Sweden's Sarah Sjostrom and Australia's Emma McKeon to win the 200 freestyle, on top of her victory in the 400 on Sunday.
She is overwhelming favourite to add the 800 title later this week, an event in which she is totally dominant, and achieve a treble at those three distances that no woman has managed since American Debbie Meyer in Mexico City in 1968.
In what might qualify as a 'too much information' moment, Ledecky underlined how gruelling the contest had been.
"Pretty sure that's the closest I've come to throwing up in the middle of a race," the teenager said. "I'm just so glad I got my hand on the wall first."
Hungary's Hosszu, who despite five world titles had come away empty-handed from three previous Olympics, won her third gold medal with victory in the women's 200 individual medley.
The 27-year-old, who set an Olympic record of 2:06.58, had already won the 400 individual medley on Saturday and 100 backstroke on Monday.
Britain's Siobhan-Marie O'Connor took silver, with Maya DiRado of the U.S. winning a bronze to add to her silver in the longer distance.
Hosszu, the 'Iron Lady' who withdrew from the 200 butterfly earlier on Tuesday to prepare for the individual medley final, is entered in one more individual event, the 200 backstroke.
If she wins that she would equal the women's record of four solo swimming golds at a single Games set by East Germany's Kristin Otto in Seoul in 1988.