Michael Phelps says he considered taking his own life on numerous occasions at the height of his career.
Phelps - the most decorated Olympian of all time with 23 gold medals - first contemplated suicide after the Athens 2004 Olympics.
The 32-year-old sought professional help after reaching an "all-time low" following London 2012.
"After every Olympics I think I fell into a major state of depression," said Phelps.
"I remember going to treatment on my very first day. I was shaking because I was nervous about the change that was coming up."
Phelps, who announced his retirement after London 2012 before returning to the sport two years later, said he realised the extent of his problems after the Games when he locked himself in his bedroom for "three to five days".
He went on to win five gold medals and one silver in Rio before again retiring, and said the emotions of overcoming his mental health issues were far greater than those from winning his Olympic titles.
Speaking at the Kennedy Forum on mental health in Chicago, Phelps added: "Those moments and those feelings and those emotions for me are light years better than winning the Olympic gold medal.
"I am extremely thankful that I did not take my life."