The 38-year-old Kallis said his poor performance in Sri Lanka prompted him to take the decision to retire though he will continue playing in the Indian Premier League and other T20 leagues.
Kallis scored 13,289 runs in 166 Tests with 45 Test centuries and 58 half-centuries at an average of 55.37 --- second only to the iconic Sachin Tendulkar.
He also had 292 wickets with five five-wicket hauls and took 200 catches in the longer format.
Often compared with the legendary Gary Sobers for his all-round exploits, former India captain Rahul Dravid had recently said that Kallis's achievements are "only second to Tendulkar".
Also Read
The Proteas legend wanted to play the 2015 World Cup in South Africa but after the series against Sri Lanka where he totalled five runs from three innings, he decided to call time on his decorated career.
"I would like to thank Cricket South Africa, the team, the team sponsors, my sponsors, the fans and all the people who have been involved in my career. It has been an amazing journey.
"I am not retiring from all cricket as I have a two-year contract with the Sydney Thunder and, if possible, to help the Kolkata Knight Riders defend the IPL title we won earlier this year," he made it clear.