Smith was Great Britain’s first individual Olympic medallist for a century when he won bronze on the pommel horse at the 2008 Games in Beijing.
He won a team silver in the pommel at London 2012 and secured another silver in Rio four years later.
Smith wrote on Facebook: “Gym has given me everything – it gave me the tools necessary to channel my ADHD throughout my childhood , and as I grew up through the sport, I very quickly found a purpose in life, and it has made me the person I am today.
“From a young age it became my dream to compete at an Olympic Games and represent Great Britain, so to have had the opportunity to do that on three separate occasions, and bring home four Olympic medals in the process, is something I will forever cherish and for which I am eternally grateful.
“I’m so proud of what I’ve achieved in the sport and hope that my achievements have left a legacy that will continue to inspire gymnasts of the future.”
Smith had been working towards qualification for the Tokyo Olympics in 2020, but now says he will pursue “other exciting opportunities that I’ve been presented with”.
Smith, who also won three World Championship medals over the course of his career, was the winner of the BBC’s Strictly Come Dancing programme in 2012.
He was given a two-month ban by British Gymnastics in 2016 after mocking Islam in a video.
Smith apologised for the footage, which showed him pretending to pray to Allah while laughing, and revealed he had received a number of death threats.
Join our new commenting forum
Join thought-provoking conversations, follow other Independent readers and see their replies