“Every cricketer has to stop at the right time,” Herath said in a statement issued through Sri Lanka Cricket.
“I feel it’s time to make room for fresh talent to be groomed with the 2019 World Cup in view.”
The 38-year-old, left-arm off spinner said Test cricket was his “personal passion,” on which he wanted to concentrate for the remainder of his playing career.
Herath has suffered from knee injuries in recent years and has largely only played limited-overs cricket at the major tournaments.
Herath was one of the stand-outs for Sri Lanka in 2014 when they lifted the World Twenty20 trophy, including taking five for three in the semi-final against New Zealand.
But Sri Lanka failed to reach the semis in the just finished 2016 edition of the tournament after a lacklustre campaign.
Herath has played 71 one-day internationals, claiming 74 wickets and conceding 2,362 runs. In the Twenty20 form, he has taken 18 wickets for 373 runs in 17 matches.
He made his ODI debut against Zimbabwe in Harare in 2004, while he played his first T20 international against Australia at Sri Lanka’s Pallekele in 2011.