Michael Phelps outdueled Ryan Lochte to win the 200-meter individual medley at the U.S. Olympic Trials on Friday while Katie Ledecky suffered her first setback on the road to the Rio de Janeiro Summer Olympics.

Ledecky, 19, had dominated the women's freestyle events but finished seventh in the 100, which was won by Abbey Weitzeil in 53.28 seconds.

The top six finishers are all placed in the U.S. relay pool.

Ledecky was much more impressive in her 800 morning heats, where the world-record holder and Olympic champion was the top qualifier after clocking the third-best time ever in the event of 8:10.91.

Phelps and Lochte provided the highlight of the night, and perhaps the entire week, with their battle in the 200 IM.

The race marked the last time Phelps and Lochte will go head-to-head in an American pool but the two swimming giants, who between them have amassed 33 Olympic medals, could clash one final time in Rio.

Phelps held off his hard-charging rival to narrowly get to the wall first in 1 minute, 55.91 seconds, the second-fastest swim in the event this year.

"Ryan and I always have great races with one another," said Phelps. "Him and I have been racing since 2004 and think when we race each other we bring each other to a different level. We take each other to that next step."

While Lochte was done for the night, Phelps still had work to do, capping off a long, grueling and emotional day by finding enough in the tank to qualify sixth fastest for the final of the 100 butterfly.