A key figure in Sri Lanka’s batting line-up for more than a decade, Samaraweera, 36, rebuilt his career after being shot in a militant attack on his team bus in Pakistan in 2009.
“I was shocked with my omission from the squad against Bangladesh,” he told reporters, adding he had been told by the selectors that they may need him for the tour of Pakistan later this year.
“There was no point in waiting for nine months. I respect the decision of the selectors to go with young players and decided it was the right time for me to retire.”
Samaraweera will, however, play for Worcestershire in English county cricket this year.
He compiled 5,462 runs in 81 Tests at an average of 48.76 with 14 centuries.
He also played 53 one-day internationals, scoring 862 runs at 27.80 with two hundreds.
His form dipped on a recent tour of Australia where he managed just 79 runs in six Test innings, the dismal performance eventually leading to his ouster from the squad against Bangladesh and his retirement.
Photos: SRK does garba, Nawazuddin takes 'shower' in bathtub
Photos: Soha Ali Khan, Evelyn Sharma, Urvashi Rautela at Mumbai airport
Spotted: Lara Dutta, Mahesh Bhupathi with their daughter in Bandra
Photos: SRK, Tamannaah Bhatia, Varun Dhawan at Mehboob Studio
Birthday special: Sushant Singh Rajput's journey from TV to films