Sri Lanka batsman Sanath Jayasuriya will retire from Tests after next week's game with Pakistan in Kandy.
But he hopes to continue his career in one-day internationals with a view to playing at next year's World Cup.
The 36-year-old said: "I thought about it long and hard and decided that's it. It's a very emotional moment."
His 14 Tests centuries include an innings of 340 against India in Colombo in 1997 which helped Sri Lanka to a record total of 952-6 declared.
Jayasuriya also made 213 when Sri Lanka won a one-off game against England at The Oval the following year and in total scored more than 6,500 runs in 101 Test appearances.
He was captain in 38 Tests, winning 18, but perhaps his finest achievement came in his first series in charge when he led Sri Lanka to their first and so far only win over Australia in 1999. In the last few months he has been dogged by injury problems.
He dislocated his right shoulder during a one-day game against India last August and aggravated it two months ago after slipping in the shower during a tour to New Zealand.
Jayasuriya missed the one-day series against Pakistan because of a thigh strain, but was back in the side for the first Test, which ended in a draw.
He managed scores of only six and 13, however, and handed a letter to Sri Lanka Cricket chief executive Duleep Mendis on Friday, informing him of his decision to retire from Test cricket.
Although Sri Lanka are looking to feed younger players into their squad, it would be a surprise if he was discarded from the one-day side before the World Cup in the West Indies.
His swashbuckling batting helped them win the trophy in 1996 and earned him the Player of the Tournamernt award.
Last year he became only the fourth batsman to pass 10,000 runs in limited-overs internationals.
Chairman of selectors Lalith Kaluperuma suggested he is likely to be kept in the side for another 12 months.
"I think that the decision to retire from Tests and the decision to play one-day cricket only is a very important one for Sri Lanka," Kaluperuma said.
"I know it is a huge vacuum to fill and it will never be easy to do so, but we will have to move on.
"We are confident that Sanath's decision will help him and Sri Lanka cricket tremendously, especially with the World Cup in 2007."
Team-mate Mahela Jayawardene said: "Sanath's contribution to cricket in Sri Lanka has been immense.
"His brilliant statistics tell only half the story - he has been a match-winner on so many occasions with both bat and ball.
"We are all hoping that he will finish with a big one next week."