Co-hosts Equatorial Guinea produced one of the all-time Africa Cup of Nations upsets when reaching the last eight and dumping Senegal out of the finals.
The National Lightning left it incredibly late to earn a 2-1 win over their supposedly illustrious foes.
After Randy opened the scoring in Bata, Senegal were facing elimination until Moussa Sow's 89th-minute equaliser.
But Kily produced a stunning 25-yard drive deep into added time to send a nation into raptures.
The goal came in the 94th minute to spark frenzy among the 40,000 fans inside the Estadio de Bata, yet there was still time for Equatorial Guinea centre-back Laurence Doe to be sent off.
When the final whistle did evenutally blow three minutes later, Equatoguineans across the world were in dreamland while any watching neutrals were probably left similarly open-mouthed.
The result means Newcastle strikers Demba Ba and Papiss Demba Cisse will be back in Premier League action earlier than expected.
To put the win into context, the co-hosts' coach Gilson Paulo only met his squad three weeks ago as he was parachuted in to lead one of the lowest-ranked teams to ever contest a Nations Cup.
Lying 151st in Fifa's rankings and making their tournament debut, the National Lightning have made a mockery of the form guide, producing a gutsy display to knock out this year's third favourites.
Senegal came into the competition with Africa's best forward line but neither Cisse, Ba nor Dame Ndoye could take any of the presentable first-half chances that came their way.
Cisse's clever volley was well saved after 16 minutes by Equatorial Guinea goalkeeper Danilo before Ba spurned a glorious opportunity as he dragged a perfect lay-off from impressive winger Issiar Dia wide.
Before the break, there was still time for Guirane Ndaw to sting Danilo's fingers with a 25-yard piledriver before Ba and Ndoye wasted yet more presentable chances.
All the while, Equatorial Guinea's defence had thrown themselves into every block with a passion that humbled their opponents.
After 62 minutes, Kily showed his quality when bending in a delicious cross that Randy - all alone at the back post and just yards from goal - was not going to miss.
Senegal had crumbled at the first sight of pressure and coach Amara Traore made instant changes, bringing on Moussa Sow and Mamadou Niang, the national captain who had been dropped to the bench.
Niang showed his class while flashing a difficult header wide as the hosts continued to frustrate the Senegalese, with Ben Konate and Doe working tirelessly to keep their side ahead.
But with one minute of normal time left, Niang latched onto a free-kick that had spilled in the box and after Danilo blocked his low shot, Sow manoeuvred his body to acrobatically volley home.
Instead of holding on to the point that would have kept them in the finals, Senegal searched for a winner which almost came through Dame Ndiaye before Javier Balboa went close at the other end.
Then came an incredible finale when Kily killed a crossfield pass with his first touch before unleashing a thunderbolt that tore into the back of the net to spark an impromptu pitch invasion.
Unknown in Equatorial Guinea at the start of this month, Paulo has become a national hero while Senegal coach Traore faces an uncertain future after falling woefully short of his semi-final target.
Pointless from their first two games, the West Africans can no longer qualify - meaning Zambia will take Group A's last quarter-final place if they avoid defeat against Equatorial Guinea on Sunday.
Meanwhile, Libya - who drew 2-2 with the Chipolopolo earlier in the day - must beat Senegal and hope the Zambians lose if they are to make it through.