Equatorial Guinea beat Tunisia in controversial circumstances to reach the Africa Cup of Nations semi-finals.
Ahmed Akaichi looked to have put Tunisia into the last four when he turned in Hamza Mathlouthi’s cross.
The hosts, ranked 96 places below their opponents, sent it to extra time when Javier Balboa netted an injury-time penalty after Ali Maaloul was harshly ruled to have fouled Ivan Bolado.
And Balboa scored the winner with a fantastic free-kick from 25 yards.
Equatorial Guinea will face Ghana or Guinea in their first Cup of Nations semi-final on Thursday.
The game ended with ugly scenes as both sets of officials and players clashed in the 120th minute, with security getting involved, and at the final whistle some Equatorial Guinea fans ran onto the pitch to celebrate a famous win.
Bottles were thrown at Tunisia players, with one Carthage Eagles player throwing one back.
The minnows, ranked 118th in the world, only entered the tournament in November when they replaced Morocco as hosts because of the Ebola crisis.
They had been eliminated from qualifying after fielding an ineligible player, only hired coach Esteban Becker 11 days before the tournament and gave five players debuts in a pre-tournament friendly.
However they qualified from Group A thanks to victory over Gabon in their final game to reach their second quarter-final. They lost the first – in the 2012 event they co-hosted – to Ivory Coast.
Tunisia, meanwhile, topped a group with DR Congo, Cape Verde and Zambia and had good reason to enter the game in confident mood.
It was a game of few chances, with Akaichi having a shot touched over by Felipe Ovono before he opened the scoring.
Emilio Nsue was denied a leveller with eight minutes left by Tunisia keeper Aymen Mathlouthi, setting up the incredible late drama.
Bolado dribbled into the area and appeared to stand on the edge of Maaloul’s foot before falling to the floor. The referee awarded a penalty in front of a partisan home crowd to a furious reaction from the Tunisian bench.
Some fans shone lasers in the eyes of Tunisia keeper Mathlouthi, who went the wrong way as Balboa rolled it into the net.
In extra time, the momentum was with Equatorial Guinea and Balboa curled home a wonderful free-kick in the first period.
Tunisia created few chances to force penalties before the match ended on a sour note with chaos in the Bata Stadium.
Earlier, DR Congo fought back from two goals down to beat neighbours Congo and reach the Africa Cup of Nations semi-finals.
Ferebory Dore volleyed Congo in front and Thievy Bifouma drove in from a rebound to make it 2-0 either side of DR Congo efforts that hit the bar.
In a 16-minute spell DR Congo’s Dieumerci Mbokani slotted in to give them hope, Bolika fired in an equaliser and Joel Kimuaki headed in a third.
Mbokani rounded off the win, stroking home after a counter-attack, reports the BBC.
AFCON 2015 RESULTS
Equatorial Guinea 2-1 Tunisia
DR Congo 4-2 Congo