Cheered on by a capacity crowd that included his fiancée and their infant son, Phelps stormed to the wall in one minute, 54.84 seconds to become the first American male swimmer to make five Olympic teams in his career.
"That means the most tonight," an emotional Phelps said about his remarkable feat. "I think with everything that has happened and being able to come back that was probably harder than any swim I have had in my life."
Already the most decorated Olympian of all-time with 22 medals, including 18 gold, Phelps will head to Rio looking to reclaim the Olympic title he won in 2004 and defended in 2008 but surrendered to South African Chad le Clos in 2012.
"I didn't feel good the first two swims, didn't really feel good tonight but getting on the team was the most important thing and that was the only thing I had to do tonight," said Phelps. "I tried to take it out and just prayed to God I was going to be able to hang on."
Phelps has trimmed back his programme for Rio, scratching from the 100 and 200 free, but will try to qualify in the 100 butterfly and 200 individual medley.
He will have little time to savour the moment as he will be back in the pool early on Thursday for the preliminary heats in the 200 IM.
"I've been in the sport a long time and just being able to finish how I want to is so important to me and getting on this team is what I wanted to do," said Phelps.