In a match that had plenty of missed opportunities, Amaglug-glug and Iraq saw their Olympic dream fade away as they finished fourth and third respectively in Group A, leaving hosts Brazil and Denmark going through to the next stage of the competition.
Needing only a win, South Africa started the tie on a bright note as they opened the scoring with their first chance on attack through Motupa, who benefited from a loose ball after a run of play in the sixth minute to give his side a 1-0 lead.
Three minutes later, a free kick just outside the box gave Iraq a chance to equalise, however, Dhurgham Ismael lifted the set piece high.
With the intensity of the game growing, Iraq were able to equalise from a corner kick thanks to skipper Saad Aluibi’s header in the 15th minute after poor defending from Owen Da Gama’s men.
Phumalane Ntshangase almost put Amaglug-glug back in the lead in the 19th, but his low shot hit the side net after Irag keeper Fahad Talib made a save.
With a couple of minutes to half-time, Iraq twice hit the crossbar and a brilliant save by Khune kept the scores level going into the break.
Iraq once again got an opportunity to take the lead in the 37th minute, but Khune made a brilliant save.
The first 15 minutes into the second half saw Iraq creating most opportunities, hitting the post for the third time in the game, with another chance being saved by Khune once more.
Motupa got a chance to register his second goal of the match, but his shot from close range was blocked by Iraq’s defence in the 64th minute.
Sherko Kareem got a glorious chance to get a second goal for Iraq in the 69th minute after being spotted at the back post. However, he was unable to control the ball with only the keeper to beat.
Young Bafana suffered a setback when an injury for young Bafana skipper Keagan Dolly saw him being replaced by Tashreeq Morris.
Both teams went in search of a winner in the last minutes of the game, but poor finishing let them down.
South Africa will now be heading home, as they finished the competition with only two points from three games.