Nigeria sneaked into the Africa Cup of Nations semi-finals when defender William Troost Ekong scored with one minute remaining to give them a 2-1 win over a gallant South Africa as the tournament served up more drama on Wednesday.
Troost Ekong, left unmarked by the South Africa defence, turned the ball in with his knee from a corner just as Nigeria seemed to be in danger of throwing away a game they had dominated for more than an hour.
Samuel Chukwueze, recalled to the side after missing the previous round, put the Super Eagles in front when he scored at the second attempt in the 27th minute.
Nigeria stayed in control, missed chances and paid the price when Bongani Zungu headed an equaliser in the 71st minute with South Africa's first shot on target.
The goal was initially ruled offside but then awarded after a VAR check -- the first major intervention by technology since it was introduced for the quarter-finals.
Nigeria, who will meet Ivory Coast or Algeria in the last four, went ahead with the first really dangerous attack of the match.
Alex Iwobi burst down the left and pulled the ball back into the area to Chukwueze whose first effort was blocked by a defender but scored after it rebounded back to him.