Bafana Bafana qualified for the 2023 Africa Cup of Nations finals following a Group K 2-1 victory over Liberia at Samuel Kanyon Doe Stadium on Tuesday.
Defying the sweltering heat of Monrovia, South Africa went ahead through Zakhele Lepasa's 19th-minute strike, before Liberia captain William Jebor restored parity in the 35th minute.
But Mihlali Mayambela then confirmed Bafana's place at Ivory Coast 2023 by grabbing the winner eight minutes into the second half to send South Africa to their 11th Afcon tournament.
Bafana arrived in Monrovia with their qualification bid hanging by a thread following last Friday's frustrating 2-2 draw with Liberia at Orlando Stadium.
But they atoned for keeping their fans uneasy with the crucial victory and a relieved Bafana coach Hugo Broos made it to his first major tournament with Bafana.
For a team that went into Tuesday's match embattled, they have now rendered their last Group K game against Morocco a dead rubber as they are assured of finishing second in this pool.
It was South Africa's first away win since October 2021 and they denied Liberia a chance at the tournament the West Africans participated in last in 2002, in what was legendary striker George Weah's international swansong.
Bafana were back at Samuel Kanyon Doe Stadium which they last visited in June 2001 when they managed a 1-1 draw in a 2002 Afcon qualifier.
This time around, they managed to collect maximum points on the artificial turf of Liberia's national ground.
The hosts made one change from the team that started last Friday, bringing in Allen Njie in place of Ghana-born Jamal Arago.
But Broos made a number of alterations with daring decisions of relegating Lyle Foster and Themba Zwane to the bench while starting Lepasa upfront.
Mayambela, Siphephelo Sithole, Nyiko Mobbie and Innocent Maela were called to the lineup.
In a first half of few chances, Lepasa repaid Broos' faith in him by beating Liberia goalkeeper Tommy Songo after being released by Thapelo Morena.
But the Liberians then hit back after Bafana captain Ronwen Williams spilled into his own net Jebor's grounder.
The visitors almost reclaimed their lead just before the halftime break but Maela mysteriously blasted his effort over the bar while facing a yawning goal.
But it paid off eight minutes into the second half when Mayambela made a follow-up to Songo's block and restored Bafana's lead for what was his second international goal.
Despite Liberia's relentless pressure in the nerve-wracking dying stages, Bafana held on to their slim lead.