Baxter, 63, who coaches Pretoria-based top-flight club SuperSport United, was hired when plans to lure Carlos Queiroz, Herve Renard or Hugo Broos failed to materialise.
Iran wanted a large pay-out to release Mozambique-born Queiroz, the former Real Madrid manager and Manchester United assistant manager.
Africa Cup of Nations-winning coaches Renard from France and Broos from Belgium could not agree terms with the South African Football Association (SAFA).
In a break with an SAFA tradition of making major announcements at media conferences, confirmation that Baxter had been appointed came via an emailed statement.
The former midfielder succeeds local Ephraim “Shakes” Mashaba, who was fired last December after publicly insulting SAFA officials, including president Danny Jordaan.
Baxter quit as South Africa coach in 2005 after failing to qualify “Bafana Bafana” (The Boys) for the World Cup in Germany the following year.
He will get a second chance this year as co-leaders South Africa face Cape Verde (twice), Burkina Faso and Senegal with a place at the 2018 World Cup in Russia going to the group winners.
His immediate task, though, is a daunting visit to in-form Nigeria during June for an opening round match in the 2019 Cup of Nations qualifying competition.
While Baxter failed to make an impact as South Africa coach the first time, and later fared equally unimpressively as Finland manager, he has enjoyed success with several South African clubs.
He guided the most popular football team in the republic, Soweto-based Kaizer Chiefs, to two league titles within three seasons.
After taking over SuperSport late last season he led the unfashionable outfit to a surprise South African FA Cup final triumph.
SuperSport went 19 matches unbeaten in the league this season before a sudden loss of form led to three straight defeats and the end of their title ambitions.
Baxter admitted that media speculation linking him to the national job could have distracted his squad and contributed to a humiliating 5-0 defeat by African champions Mamelodi Sundowns.
SuperSport are still in the hunt for trophies, however, having reached the South African Cup semi-finals and the CAF Confederation Cup group phase.
Baxter, who had emergency surgery last week to remove a cyst, did not immediately comment on his appointment — another break with tradition.
SuperSport chief executive Stanley Matthews said: “We did not want to lose Stuart as our coach. He has done a great job in getting us to the competitive level we expect as a club.
“However, we also understand that Stuart would like to have a final go at competing at a World Cup, and that would be a fantastic achievement for the country as a whole.”
Baxter will begin his second spell as South Africa coach after the final league fixtures on May 27.
Would you like to place a soccer bet? Click here to get started in 3 easy steps.