South Africa is into the quarter-finals of the Africa Cup of Nations after a shock 1-0 win over host Egypt in Cairo.

Thembinkosi Lorch struck in the closing stages to stun Javier Aguirre's side and keep alive its challenge to become the continental champion for just the second time.

Stuart Baxter's side came in for heavy criticism during the group stage as it scraped through despite losing to Ivory Coast and Morocco, but it responded with a disciplined and clinical display that saw it keep Mohamed Salah quiet and make the most of Lorch's late opening.

READ : Salah reveals how painful picture motivated Liverpool in Madrid

It will face Nigeria in last eight after the Super Eagles earlier saw off Cameroon 3-2 in a thriller.

Percy Tau's dipping free-kick was brilliantly tipped over by Mohamed El-Shenawy as the half begun in lively fashion.

The best chance of the first 45 minutes fell to Trezeguet, who could only shoot tamely at Ronwen Williams after being set up by Salah following a quick break.

Trezeguet was again set up six yards from goal after a brilliant pass from Salah early in the second half, but his finish was once more a poor one.

READ : AFCON 2019 serves up old-school refereeing

Egypt was beginning to assume more control on proceedings but creating chances was still posing a problem, and South Africa captain Thulani Hlatshwayo was only feet from finding the bottom-left corner with a header from a Lorch delivery.

As Egypt continued to throw caution to the wind, it was stung on the break with five minutes of normal time to go. A well-worked move saw Lebo Mothiba stride into space and square the ball for Lorch, who kept his composure to side-foot past El-Shenawy and send his side into the last eight.