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, Cricket South Africa has allowed me to go and play around the world in various leagues."