The 34-year-old De Villiers, who captained the Boks 37 times, has retired as the second most capped Springbok captain of all time, and is currently the fourth most capped player in the history of South African Test rugby, with 109.
"When I got injured yesterday and I left the field, I knew that I had played my last Test for South Africa," said De Villiers, who became the 54th Springbok captain when he was appointed by Heyneke Meyer in June 2012.
"The last time I got injured in a World Cup match and had to go home, was in 2007, also against Samoa, and that finished well for the Boks, so hopefully it will happen again.
"I was quite sad on the one hand when I came off the field, as I knew I won't get the opportunity to play for my country again. Having played for South Africa for 13 years, I've been fortunate to experience so many great things and I got to know so many good friends, but you never think it would end like this.
"It has happened now and I'll be eternally grateful for the time I've had in the Springbok jersey. I would like to wish the team all the very best and as a former Springbok, I'm now their number one supporter," he added.