Hosts Ivory Coast stunned Senegal at the Africa Cup of Nations (Afcon) on Monday, knocking out the reigning champions on penalties in the last 16 to keep their hopes of winning the title on home soil alive.
A week ago, it looked as if the Ivorians were set for a humiliating group-stage exit from their own Afcon, but now they are into the quarterfinals after beating Senegal 5-4 on penalties following a tie that finished 1-1 at the end of extra time.
The Elephants scraped into the knockout phase with the worst record of the four best third-placed sides to advance, after finishing the first round with a humiliating 4-0 loss to Equatorial Guinea, their heaviest ever home defeat.
They followed that by sacking veteran French coach Jean-Louis Gasset and trying unsuccessfully to bring in former boss Herve Renard on a short-term deal.
But instead, former player Emerse Fae was appointed on an interim basis, hoping to rouse a shell-shocked team for a daunting tie against the holders.
It looked like being a trying evening for Ivory Coast in Yamoussoukro as Senegal went ahead in the fourth minute when Habib Diallo brought down Sadio Mane's cross from the left and finished emphatically.
Mane then escaped with a yellow card for a dangerous challenge on Ibrahim Sangare soon after, although Senegal also felt hard done by early in the second half.
Ismaila Sarr went down in the box in a tangle of legs with Odilon Kossounou, but no penalty was given, and the referee did not come across to review the incident on the pitchside monitor.
Kessie the hero
Instead, it was the Ivorians who won a late penalty of their own, a VAR review showing that Nicolas Pepe was chopped down by Senegal goalkeeper Edouard Mendy.
Franck Kessie of Saudi club Al Ahli, who was dropped to the bench at kick-off, converted the penalty to force extra time.
With no further scoring, it came down to penalties, and Senegal's Moussa Niakhate was the only player to miss, seeing his effort strike the post.
Kessie then netted the decisive kick to take Ivory Coast through to a last-eight tie against Mali or Burkina Faso in the central city of Bouake on Saturday.
Neighbours Mali and Burkina Faso clash in the last 16 in the northern city of Korhogo on Tuesday.
"We are feeling a lot of emotion," Ivory Coast striker Sebastien Haller told broadcaster Canal Plus Afrique.
"The last few days have not been easy, but we had to believe in ourselves."
Senegal goes out after being the only team to win all three games during the group stage, and their elimination means no reigning champion has made it beyond the first knockout round of a Cup of Nations since Egypt won a third consecutive title in 2010.
Mauritania run ended
Earlier on Monday, Cape Verde won an Afcon knockout tie for the first time in their history as a late Ryan Mendes penalty gave them a 1-0 victory over Mauritania in Abidjan.
The tie was drifting towards extra time when Cape Verde won a spot-kick as substitute Gilson Tavares Benchimol was brought down in the box by Mauritania goalkeeper Babacar Niasse.
Captain Mendes then converted with just two minutes of the 90 remaining to break the resistance of a Mauritania side appearing in the knockout phase for the first time.
Cape Verde advance to a quarter-final on Saturday in Yamoussoukro against either Morocco or South Africa, who meet in the last 16 on Tuesday in San-Pedro.
The tiny Atlantic Ocean island nation had got out of their group in two of their three previous appearances at the Afcon but had never before won a knockout tie.
"We are proud of everything we have done up to now. We always tried to win the game and we thoroughly deserved the victory," said Cape Verde coach Pedro 'Bubista' Brito, who believes his side can go further still in the tournament.
"We have our objective, which from day one has been to get to the semi-finals.
"We are one step away from that now and we are going to keep going, while obviously staying humble and respecting our opponents, but we believe. That is our focus, and we are going to try and get there."