Phelps on course for Rio
Michael Phelps was edged out by Ryan Lochte in a dramatic finale at the US National Championships - but achieved the first step towards his goal of racing at Rio 2016.
The good news for Phelps - winner of 18 Olympic gold medals - is that he qualified for the US team for the Pan Pacific Championships in Australia later this month and also earned a ticket to next year's world championships in Kazan, Russia.
That ensures he is on course to qualify for Rio in two years' time.
Phelps, who came out of retirement in May after quitting the sport following the 2012 London Olympics, was using the national championships to determine whether he would push through to Rio.
His fellow Olympic champions Allison Schmitt, Natalie Coughlin and Katie Hoff, however, failed to make the team for the Pan Pacifics.
Lochte held off a fast-finishing Phelps to win the 200 metres individual medley, touching in a time of 1:56.50, just ahead of the American legend in 1:56.55.
Trailing by almost a second and a half at one point, Phelps - who finished the championships without a victory - displayed his famous finishing kick and nearly made up the deficit in the final metres to bring the crowd to its feet.
"We both hate to lose but we enjoy racing each other," Phelps said. "Hopefully we can push each other and see what happens."
Katie Ledecky had set a new world mark in the 400m freestyle on Saturday but the 17-year-old decided to pull out of the 1,500m in California.
Missy Franklin had a day off too but was honoured as the high point award winner on the women's side. Her nationals meet included a win in the 100m and second place in the 200m freestyle.
Matt Grevers, winner of the 100m backstroke, took the award on the men's side.
Sunday's winners included Simone Manuel, who captured the 50m freestyle with a time of 24.56 and managed to turn a recent weakness into a strength.
"I wanted to have a good finish. That's something I've been struggling with," said Manuel, who also finished second in the 100 freestyle. "In the 50 free you have to get everything as perfect as possible."
With Ledecky out of the 1,500m, Kathy Campbell won the event with a personal best time of 16:17.69.
Melanie Margalis claimed the 200m IM in 2:10.20, while Michael McBroom swam through the pain to win the 800m freestyle.
"The second 400 (my body) started to hurt, but I did my best to ignore it," he said. "I just wanted to get the title. I think it sets up well for me to cut my time moving forward."
Anthony Ervin turned back the clock in winning the 50m freestyle. The 33-year-old won 14 years after earning a gold medal in the event at the 2000 Olympics.