South Africa warmed up for their upcoming appearance at the Olympic Games with a morale-boosting, if controversial, success in the Cosafa Castle Cup on Saturday, winning the title with a 3-2 victory over Botswana in the final in Windhoek.
A disputed penalty in the last three minutes handed the under-23 team the title in the annual southern African championship in front of a boisterous crowd at the Sam Nujoma Stadium, with the team using the tournament in Namibia to prepare for the Olympics in Brazil in August.
It is the fourth time that South Africa have won the trophy, meaning they now share with Zimbabwe the mantle of the most successful side since the tournament was first introduced almost two decades ago.
Botswana were playing in a first final and their English coach Peter Butler was in a sour mood after the game. "If this region wants to progress then they must do something about the disgraceful refereeing," he said after Janny Sikazwe of Zambia had sent him off in the quarter-final and then returned to haunt Botswana in the final with a call that looked to have been hastily made and without proper sight of the incident.
The referee had already handed South Africa a penalty in the first half when Judas Moseamedi was brought down but the decision against Joel Mogorosi looked ill judged.
Butler had good cause for his rant although Botswana did get themselves back into the game at 2-2 with a horror error from South Africa goalkeeper Reyaad Pieterse who let a free kick - which hit his near post - slip through his hands and into the net in an embarrassing blunder.
Well supported by fans that travelled across the Kalahari Desert to watch their team in the final, Botswana will know a good chance escaped them.
The tournament also proved disappointing for Namibia, who as surprise winners last year sought a successful defence in front of their home support.
But they went out at the first hurdle despite fielding a full strength side and played on in the plate event, which they won on Friday.
The tournament was originally scheduled for mid-May and was designed to be held before the round of the African Nations Cup qualifiers in June. That would have meant a warm-up and countries would have taken their strongest squads to Windhoek.
Instead it was moved to after the qualifiers and as a result South Africa, Zambia and Zimbabwe left their first choice players at home to enjoy the post-season holidays. Angola sent an under-20 side and Madagascar and Mozambique were among others who did not call up any of their European-based contingent. As a result a chance to enhance the credentials of the event was missed.
The Democratic Republic of Congo were invited as guests - as the Comoros Islands had pulled out - and also used only a home-based squad although it was largely similar to that which won the African Nations Championship in Rwanda and were therefore highly fancied.
Swaziland's progress over the last 12 months exemplifies the value of the annual event in increasing international competition, affording countries a chance to develop faster than they might on an ordinary diet of warm-up friendlies.
They showed their potential at the 2015 tournament and straight from that went on to beat Guinea away at the start of the 2017 Nations Cup qualifiers.
They have since given themselves a chance to reach the finals in Gabon, and at this Cosafa Cup came through the first round of group matches - eliminating Zimbabwe - before going on to finish third by beating the Congolese 1-0 in the third place play-off on Saturday.