Ismahila Ouedraogo scored the decisive penalty kick as Burkina Faso beat Gabon 7-6 in a dramatic shoot-out to progress to the quarter-finals of the Africa Cup of Nations after Sunday's match in Limbe finished 1-1 at the end of extra time.
Burkina Faso beat Gabon on penalties to reach AFCON quarter-finals
Burkina Faso goalkeeper Herve Koffi is hoisted high during his team's victory celebrations
Burkina Faso appeared to have victory sewn up in normal time in the last-16 tie thanks to a first-half goal from captain Bertrand Traore, who had earlier missed a penalty.
Gabon were reduced to 10 men when centre-back Sidney Obissa was dismissed midway through the second half, but they forced extra time as the unfortunate Adama Guira helped the ball into his own net in the first minute of added time.
After there was no scoring in the extra half-hour, penalties went all the way to sudden death and Lloyd Palun became the third Gabon player to miss his attempt before Ouedraogo took the Stallions through.
The 2013 runners-up advance to a last-eight tie in Garoua next Saturday against the winner of Sunday's late tie between Nigeria and Tunisia.
"It was a crazy game and it was not easy to control our emotions. We had chances to kill the tie earlier but that's football. It could have gone either way, but we are delighted with the outcome," said Burkina Faso coach Kamou Malo.
Gabon go home after a tournament overshadowed by the early departures of star striker Pierre-Emerick Aubameyang and influential midfielder Mario Lemina.
The two players were sent home last week without having played a minute for Patrice Neveu's side at the tournament after testing positive for Covid-19.
"We tried to make up for losing them but you can't easily replace international-class players like that," said veteran Frenchman Neveu.
Their exit here means the Panthers have still never won a knockout tie at the Cup of Nations, but they can be proud of the way they battled in adversity to force extra time and penalties after Obissa's red card.
Qualification is a huge boost for Burkina Faso as the west African state deals with a jihadist insurgency.
On Sunday gunfire was reported at army barracks around the country as soldiers staged mutinies to demand the sacking of leading members of the military, prompting fears of a coup.
That could only have been a distraction for Malo's team, who saw Aston Villa star Traore cannon his early spot-kick off the top of the bar.
Burkina Faso went ahead on 28 minutes as Dango Ouattara's superb through ball was met by Traore with a first-time finish in off the post with Gabon goalkeeper Jean-Noel Amonome off his line.
Gabon's chances of rescuing the tie were dealt a hammer blow midway through the second half when Obissa fouled Ouattara and was shown a second yellow.
Then, against all the odds, Gabon's Bruno Ecuele Manga appeared at a corner in the first minute of added time, his effort going in off the unfortunate Guira.
Abdoul Tapsoba had a goal ruled out for Burkina Faso in the first half of extra time, and he also had his kick saved in the shoot-out, but his team prevailed, and goalkeeper Herve Koffi led the celebrations with a remarkable series of cartwheels.