Sarfraz will be forced to miss the final two ODIs against South Africa, and then two of the three T20s that follow. The PCB said he will not play the third T20 either, but return home "immediately". Shoaib Malik will captain in his absence.
The ICC release said that Sarfraz will also have to attend "an education programme to promote the understanding and awareness of issues directly relevant to the offence that he has committed".
Remarkably that ICC release was made public half an hour after the world realised that Sarfraz wasn't playing in the fourth ODI at the Wanderers because Malik turned up for the toss in his place.
"We wanted him [Sarfraz], but the incident... we all know what has happened," Malik said. "I don't want to comment about it. But they've given me this opportunity, and I want to do my best."
Malik later said he only found out he would be captaining the team on the morning of the match. "When we got to the ground, that's when I came to know I'm captaining the side. It's a great honour to represent your country as a captain or a player, and whenever the opportunity comes to you should give your best shot. And that's what I did."
It was actually South Africa captain Faf du Plessis who first indicated that Sarfraz had been handed a four-match ban. "We've heard that he's out for four games," he said during his toss interview.
In Durban, during the second ODI, during Phehlukwayo's innings, as he got South Africa's wobbling chase back on track, Sarfraz was heard on the broadcast stump mics saying in Urdu: "Abey kaale, teri ammi aaj kahaan baitheen hain? Kya parwa ke aaye hai aaj?"
Translated literally that is: "Hey black guy, where's your mother sitting today? What [prayer] have you got her to say for you today?"
Since then, Sarfraz has apologised twice, the first an apology in the general direction of nobody, but then backed up by a personal one to Phehlukwayo. The day after the match, Sarfraz tweeted that his comments were "not directed towards anyone in particular". Then, two days ago, Sarfraz tweeted a picture of himself shaking hands with Phehlukwayo, with this caption: "This morning I apologised to Andile Phehlukwayo and he was gracious enough to accept my apology and I hope the people of South Africa also accept my apology."
The punishment came five days after the incident, allowing Sarfraz to play the third ODI in Cape Town. Ahead of that game, du Plessis said his team had forgiven Sarfraz for the comments.
ICC CEO David Richardson said Sarfraz's apology was taken into account when deciding on his penalty. "The ICC has a zero-tolerance policy towards conduct of this nature," he said. "Sarfraz has promptly admitted the offence, was regretful of his actions and has issued a public apology, so these factors were taken into account when determining an appropriate sanction."
Pakistan do not have a back-up wicketkeeper in their T20 squad, so Mohammad Rizwan, who took the gloves in Johannesburg, will stay on for the T20s.