Mahela Jayawardene was dismissed for 54 in his last Test innings on the fourth day of the second Test against Pakistan on Sunday.
The 37-year-old, who started the day on 49, reached his 50th Test half-century before falling to off-spinner Saeed Ajmal 30 minutes after the start.
Jayawardene mistimed a lofted shot to mid-wicket where Ahmed Shehzad took a low tumbling catch to the dismay of some 3,000 home fans at the Sinhalese Sports Club.
One run earlier, he had survived an appeal for a catch off Wahab Riaz after replays showed the ball touch the ground before landing in wicket-keeper Sarfraz Ahmed`s gloves.
The Pakistani fielders applauded as the crowd gave the departing Jayawardene a standing ovation. The batsmen raised his bat to acknowledge the cheers before walking off.
The 149-Test veteran finished with 11,814 runs at an average of 49.84 with 34 centuries and 50 half-centuries.
Having begun his last Test with an average of 50.02, Jayawardene saw it drop after being dismissed for four and 54 in the match.
Jayawardene, who retired from Twenty20 internationals after Sri Lanka`s title-winning campaign in the World T20 in April, will now play only one-day cricket heading into next year`s World Cup Down Under.
The elegant right-hander is one of only five batsmen to score more than 11,000 runs in both Test and one-day cricket — the others being Sachin Tendulkar, Ricky Ponting, Jacques Kallis and team-mate Kumar Sangakkara.