David Kily's stunning stoppage-time strike sent co-hosts Equatorial Guinea into the quarter-finals of the African Nations Cup with a 2-1 win and left Senegal facing up to the ignominy of elimination after just two games.
Kily struck a long-range effort deep into time added on after Moussa Sow's 89th-minute strike for Senegal had cancelled out Randy's opener after 62 minutes.
The winning goal sparked emotional scenes at the final whistle, with the result far beyond the expectations of the players or their fans at the Estadio de Bata.
Laurence Doe saw red for Equatorial Guinea in the seventh minute of stoppage time after picking up a second booking for apparent time-wasting, but he will only miss his side's final group game, now little more than a dead rubber.
Despite a miserable recent history at this tournament, Senegal came into this year's edition as one of the favourites for the title, but a second defeat in as many games has delivered a terminal blow to their chances, with Amara Traore's men now unable to qualify from Group A in their final game.
Libya and Zambia were made to work hard to take a point apiece from Wednesday's rain-affected 2-2 draw in African Nations Cup Group A.
The match got under way 75 minutes late after a heavy downpour arrived shortly before the scheduled kick-off time.
The rain left the pitch at the Estadio de Bata severely waterlogged and caused flooding in the players' tunnel, but after the weather abated during the delay the match was given the green light.
Libya twice went ahead through Ahmed Saad but Zambia secured a share of the spoils thanks to goals by Emmanuel Mayuka and Christopher Katongo.
The result leaves Zambia on four points following their victory over Senegal in their opening match, while Libya are off the mark after losing their first fixture 1-0 against co-hosts Equatorial Guinea.