Sri Lanka Cricket (SLC) said Jayawardene, 37, has written a letter to the chief executive officer Ashley De Silva announcing his wish to retire from the longest version of the game. (Agencies)
"It was not an easy decision to make given that it has been a great privilege and honour representing my country during the past 18 years, but I believe this is the right time", Jayawardene was quoted as saying.
The veteran batsman will play two Tests against South Africa on July 16 and July 24, respectively, followed by a two-match series against Pakistan in August.
Jayawardene, though, added that he was fully committed to represent the country in the one-dayers.
This would mean that Sri Lanka will not miss him during the World Cup 2015 to be hosted jointly by Australia and New Zealand.
Jayawardene, who made his Test debut against India in 1997, played 145 Tests scoring 11,493 runs with 33 centuries and 48 fifties.
Jayawardene (22 and 79 runs) recently made his presence felt in a 100-run win against England at Headingley to give Sri Lanka their first Test series victory -- the Islanders won the two-match series 1-0 on English soil.
The Colombo-born player also made a vital 24-run contribution in his final Twenty20 appearance against India in the World Cup final in Mirpur on April 6.
Sri Lanka Cricket (SLC) said Jayawardene, 37, has written a letter to the chief executive officer Ashley De Silva announcing his wish to retire from the longest version of the game.