SAFA listed the Nigerian coach as one of the candidates to replace Gordon Igesund as the Bafana Bafana coach but had to appoint one of its local coaches to tinker their national team.
The appointment of Mashaba comes as a big surprise with Iran's coach Carlos Queiroz believed to have been the front-runner alongside Keshi for the plum job to coach South Africa.
It is understood that the wage demands of Queiroz hindered him from getting the job,which led to the appointment of Mashaba who was more cheaper.
SAFA president Danny Jordaan: "the appointment of Shakes Mashaba was a unanimous decision by the NEC."
This will put an end to speculation linking Keshi with the South African job,and it appears that he will now have to make do with managing the Super Eagles of Nigeria.
Already the Nigeria Football Federation(NFF) have said that they are working on renewing Keshi's contract within the next seven days.