South Africa have sacked coach Ephraim Mashaba one day before the team leaves for the African Nations Cup finals.
Assistant coach Styles Phumo has been appointed as his replacement.
Mashaba had been suspended for the last seven days for an alleged breach of contract.
His dismissal came in a letter sent by the South African Football Association (SAFA).
“In light of the failure your services are hereby cancelled,” the letter, signed by SAFA’s chief executive officer Albert Mokoena, said.
AFA earlier claimed Mashaba had failed to monitor the form of the country’s foreign-based footballers and to promote the ruling body’s image.
Mashaba went to court on Tuesday seeking to overturn his suspension by arguing that the ban made it impossible “for me to comply with contractual requirements to remedy the alleged breaches”.
South Africa are in Group D at the Nations Cup finals along with Nigeria, Morocco and Benin, who they play in their opening game on January 27.