Tahir, who has taken 156 wickets in 95 one-day internationals, played in the 2011 and 2015 World Cups. He also played in the 2014 and 2016 World T20 tournaments
Veteran leg-spinner Imran Tahir said on Monday he would retire from one-day international cricket after the World Cup in England and Wales, which ends on July 14.
But he said he would like to continue playing for South Africa in Twenty20 internationals.
Tahir, who will turn 40 later this month, played a starring role for South Africa, taking three for 26, in their eight-wicket win in the first one-day international against Sri Lanka at the Wanderers Stadium on Sunday.
His performance drew attention to the fact that he was not on the list of contracted players for the 2019/20 year released by Cricket South Africa last week.
But he revealed on Monday that he had reached an agreement with CSA for his contract to expire at the end of July, extending his 2018/19 contract by three months.
In a statement released by CSA, Tahir said he would re-assess his freelance future after the World Cup.
"I have always wanted to play in the World Cup," he said. “I have a mutual understanding with Cricket South Africa and going forward I decided that I would finish at the World Cup, that is why I am contracted until then. After that, CricketSouth Africa has allowed me to go and play around the world in various leagues but I would also love to play T20 cricket for South Africa."
Tahir said retiring from one-day internationals was a difficult decision. "I would love to play for as long as I can," he said, "but there is a stage in your life where you have to make big decisions."
He said, though, that he would like to play for South Africa in the 2020 ICC T20 World Cup in Australia.
Tahir, who has taken 156 wickets in 95 one-day internationals, played in the 2011 and 2015 World Cups. He also played in the 2014 and 2016 World T20 tournaments.