Warburton, whose ad was published jointly by the Welsh Rugby Union and its regional team Cardiff Blues, had undergone knee and neck surgery the previous year.
He said: “Unfortunately, after a long period of rest and rehabilitation, the decision to retire from rugby was taken with my health and well-being as a priority as my body cannot give me back what it had hoped for in my return to training.”
Warburton is one of only two players to have captained the Lions on two separate tours, emulating England’s Martin Johnson, and has never lost a Test series.
With Warburton as skipper, the Lions beat Australia 2-1 in 2013 and drew the 2017 series against New Zealand. He also led Wales to Six Nations glory twice, including the 2012 Grand Slam.
The Cardiff-born winger, whose last match was in the third Test draw against New Zealand at Eden Park in July 2017, also led Wales to the 2011 World Cup semi-finals.
He captained his country in 49 of his 74 appearances and managed the Lions five times.
Despite a long list of injuries throughout his playing career, Warburton was among the best wide-backs in the world, with some critical and daring work on the break proving his greatest strength.
Current Wales head coach Warren Gatland, who appointed Warburton as patron of Wales in 2011 and to manage the two Lions tours the New Zealander head coached, led the Warburton tributes.
“He is an outstanding rugby player and has brought a lot to the game, on and off the pitch,” Gatland said.
“His leadership, attitude and demeanor, along with his performances, have established Sam as one of the best and most respected players in the world.”