"We both hate to lose but we enjoy racing each other," Phelps said after the narrow loss to Lochte.

"Hopefully we can push each other and see what happens."

For Phelps, the result was a positive sign that his comeback from retirement is on the right track after finishing seventh in the 100m freestyle on Wednesday and second in the 100m butterfly on Friday.

Phelps was slow out of the blocks and ceded control to Lochte, who was on world-record pace over the first 50.

The victory earned five-time Olympic gold medallist Lochte his first medal of the meet.

Lochte has been working on a comeback of his own. He was competing in his second meet since tearing his medial ligament earlier in the year.

"This year has been up and down but I'm glad I got a win, it feels good," Lochte said.

Phelps has had mixed results since returning to the sport earlier this year but said he felt better at the end of the nationals than he did at the start.

Phelps makes US squad as Olympic hopes build

Phelps overcame the first hurdle to a potential return to Olympic competition when he was named along with exciting teenagers Katie Ledecky and Missy Franklin on the US team for the Pan Pacs.

Phelps's qualification for the championships on the Gold Coast has also earned the 29-year-old a ticket to next year's world championships in Kazan, Russia.

Fellow Olympic champions Allison Schmitt, Natalie Coughlin and Katie Hoff, however, failed to make the team.

The trio failed to make the top three in any of their individual events at the qualifiers in Irvine, California and were not included in the 60-strong squad that also earned selection for the world championships.

Phelps was using the national championships to determine whether he would push through to Rio.

Ledecky, who qualified in the 200m, 400m and 800m freestyle, set a world record in the 400m in Irvine after having broken the 800m and 1,500m freestyle records at a Texas meeting in June.

Franklin, who won four golds at the London Olympics, qualified for the 100m and 200m freestyle and 100m and 200m backstroke.

It's a fundamental human yearning to be a part of something bigger than one's self, and maybe that's what drove my mate Ash to die, far from home, in a bloody foreign war against Islamic State, writes C August Elliott.