The 31-year-old will miss the remaining two matches of the ongoing ODI series against South Africa as well as the first two matches of the T20I series, starting February 1.
"The ICC has a zero-tolerance policy towards conduct of this nature. Sarfaraz 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," said ICC Chief Executive David Richardson.
Sarfaraz was caught on the stump microphone making an alleged racist remark in urdu language towards Phehlukwayo in the 37th over of South Africa's run chase on Tuesday.
"Abey kaale, teri ammi aaj kahaan baitheen hain? Kya parwa ke aaye hai aaj (Hey black guy, where's your mother sitting today? What have you got her to say for you today)?" Sarfaraz had said.
He later issued an apology in is twitter account. He also apologised to Phehlukwayo in person, which the South African all-rounder accepted.
"As per Article 7.3 of the Anti-Racism Code, Sarfaraz will also have to undergo an education programme to promote the understanding and awareness of issues directly relevant to the offence that he has committed," ICC said.
"The ICC will work with the PCB to determine when and how this should take place."
The incident was initially reported by Ranjan Madugalle of the Emirates Elite Panel of ICC Match Referees after he conducted initial investigations and spoke to both players after the match.
Following a further investigation, the ICC General Counsel, Iain Higgins, then determined that the player had a case to answer under the Code, and the player was issued with a charge notice on January 26.