Mohamed Bayo scored in the eighth minute of stoppage time to send Guinea into the Africa Cup of Nations quarter-finals with a 1-0 win over 10-player Equatorial Guinea.
The game was heading for extra-time when Ibrahim Diakite crossed for Bayo to finally break the deadlock with a header inside the near post.
- AFCON 2023: Fixtures, results, schedule
- Watch AFCON highlights for free on Sky Sports
- Get Sky Sports | Get NOW to stream big moments
It was effectively the last play of the game and left Guinea's exhausted opponents slumped on the field.
A majority of the 36,340 fans in attendance celebrated, mindful of Equatorial Guinea's 4-0 win over host nation Ivory Coast in the previous match, a result that almost knocked the hosts out.
Equatorial Guinea defender Federico Bikoro was shown a straight red card in the 55th minute for kicking Bayo while attempting a clearance.
They looked set to take the game into extra-time after Guinea striker and tournament top scorer Emilio Nsue missed a penalty in the 69th minute when his spot-kick struck the right post.
Guinea will next face DR Congo or seven-time champions Egypt, who play their round-of-16 game later on Sunday in San Pedro. Both teams are looking for their first win after drawing all their group games.