AmaGlug-Glug just needed a draw to progress ahead of Tunisia, due to scoring more goals in their first two games.
The South Africans set up camp solidly. After nine minutes SA midfielder Gift Motupa placed his effort wide of the target from range, as it was a period they had controlled.
However opportunities were taken from outside the box, including one by Menzi Masuku after 22 minutes, which was well saved by Sabri Ben Hsan.
Then he tipped Keagan Dolly’s free-kick over the bar. Jelassi had a free-kick for Tunisia in the last minute of the first half, and that effort was cleared away by Kwanda Mngonyama.
Nader Ghandri’s header at the start of the second half signalled a bright restart for Tunisia. The effort was tipped over the cross-bar by Jody February.
Abbubakar Mobara surged forward and unleashed a long range attempt on the hour, but it sailed over.
Then Ghandri’s effort went just wide in the 74th minute. With eight minutes to go Masuku was played through by Gift Motupa, and with the goal at his mercy he somehow contrived to fail to get a shot in due to a poor touch.
The Tunisians were caught out at the back because they were desperate to get the all-important goal to take them through, this time Mahlambi’s cross finding Masuku in the 85th minute.
The Orlando Pirates man didn’t waste this opportunity, and SA has one more step to reach Rio 2016.