Rio 2016: Michael Phelps qualifies for his fifth Olympic Games
He was arrested for drink-driving later that year and was banned from competitive swimming for six months.
Phelps, 31, said after qualifying: "That was probably harder than any swim I have had in my life."
He is the first American male swimmer to make five Olympic teams.
Phelps said he felt the achievement was greater because of "the ups and downs we`ve gone through in and out of the pool to get to this point".
Elsewhere, 400m freestyle world champion Katie Ledecky and Missy Franklin, a five-time medallist in 2012, both qualified for Rio after finishing first and second respectively in the 200m freestyle.