Former Sri Lanka captain Mahela Jayawardene will retire from Test cricket in August.
Jayawardene, who has scored 33 centuries in 145 Tests, will quit after the home series against Pakistan.
Sri Lanka begin the first of two Tests against South Africa on Wednesday, before they entertain Pakistan in another two-match series.
Jayawardene, who made his debut for his country in 1997, has scored 11,493 Test runs, at an average of 50.18.
In April, Jayawardene retired from Twenty20 cricket, after helping Sri Lanka win the World T20 title, although he will still be available for next year's 50-over World Cup in Australia and New Zealand.