William Troost-Ekong celebrates scoring Nigeria's 89th minute winner against South Africa in the African Cup of Nations in Cairo ©Getty Images

Senegal and Nigeria became the first two countries to reach the semi-finals of the African Cup of Nations in Egypt with narrow victories over Benin and South Africa respectively.

Senegal were first to reach the last four as they ended the run of Benin with a 1-0 victory at the 30 June Stadium in Cairo. 

The three-time winners Nigeria then beat South Africa 2-1 with an 89th minute winner at the Cairo International Stadium before a crowd of 48,343. 

William Troost-Ekong's dramatic late goal broke the hearts of a South African team who had only qualified as the last of the best third-placed teams and then shocked the hosts Egypt by beating them 1-0 in the round of 16.

Samuel Chukwueze had put Nigeria ahead in the 27th minute before Bongani Zungu equalised for South Africa in the 71st minute with a header initially ruled out for offside before it was allowed to stand after the incident was reviewed by the video assistant referee (VAR) introduced at this stage of the tournament for the first time. 

Troost-Ekong's winner came following a mistake by South African goalkeeper Ronwen Williams who had misjudged Moses Simon's corner.

Nigeria are now set to face the winners of the quarter-final between Ivory Coast or Algeria, due to take place at the Suez Stadium tomorrow, in a match scheduled for Sunday (July 14). 

Senegal's winning goal in the 69th minute was crafted on Merseyside as Liverpool's Sadio Mané was the architect of a move which allowed Everton's Idrissa Gueye to score.

Idrissa Gueye scores the winning goal which put Senegal through to the semi-finals of the African Cup of Nations with a 1-0 victory against Benin in Cairo ©Getty Images
Idrissa Gueye scores the winning goal which put Senegal through to the semi-finals of the African Cup of Nations with a 1-0 victory against Benin in Cairo ©Getty Images

The margin of victory could have been more comfortable for Senegal if Mané had not had two goals ruled out by the VAR.

Benin's Olivier Verdon was sent off near the end for a foul on Gueye in a match watched by a crowd of only 5,798. 

Benin had only reached this stage after drawing all three of their matches in Group F and qualifying as one of the best third-placed teams.

They then beat Morocco 4-1 on penalties in the round of 16 after a 1-1 draw.

Senegal have now won four of their five matches in Egypt and the only goal they have conceded was in their 1-0 defeat against Algeria in Group C.

They have never won this tournament but will be feeling increasingly confident ahead of their scheduled semi-final against underdogs Madagascar or Tunisia in Cairo on Sunday.

Madagascar and Tunisia are due to meet tomorrow night at the Al Salam Stadium in Cairo.