Alain Traore netted a late stunner as Burkina Faso beat Ghana 1-0 to clinch third place at the 2017 Africa Cup of Nations.
The bronze-medal game in Port-Gentil appeared to be headed for penalties, but the attacking midfielder decided different with a sublime free-kick into the top corner with one minute left to go.
It was all Ghana in the opening stages and Emmanuel Agyemang-Badu and Bernard Tekpetey both created gilt-edged chances to open the scoring.
Neither managed to find the net, though, and they were made to pay for their profligacy in front of goal in the second half, with Alain Traore sealing the bronze medal late on.
Ghana coach Avram Grant opted to make a number of changes to his team after their 2-0 semi-final defeat at the hands of Cameroon, with Christian Atsu and Andre Ayew among those dropped.
Burkina Faso boss Paulo Duarte, meanwhile, largely stuck to the team that lost to Egypt after penalties, although Alain Traore returned to the starting XI at the expense of Abdou Razack Traore.
Ghana made an encouraging start to the game and could have gone a goal up after just three minutes. Andy Yiadom did well to set up Agyemang-Badu with a cross from the left after a sublime individual piece of skill, only for the midfielder to send his header from close range inches wide of the target.
Tekpetey should perhaps have handed Ghana the lead after all halfway through the first half after a corner from Jordan Ayew. The Schalke youngster got a clear chance to break the deadlock after his initial header was blocked by Bertrand Traore, but he was unfortunate to see his attempt from the rebound hit the crossbar, before goalkeeper Kouakou Koffi cleared the danger.
Burkina Faso got a fine chance of their own in the closing stages of the first half via Prejuce Nakoulma. The winger danced past two opponents after cutting inside from the left following a quick counterattack, then fired just wide as he slightly lost his balance.
Grant's men continued to dominate after the interval and Jordan Ayew was unfortunate not to open the scoring when he fired a shot inches over the top corner early in the second half.
Ghana continued to push for an opener and Tekpetey threatened again at the hour mark after a free-kick from Jordan Ayew, sending a powerful header just over the crossbar.
Substitute Cyrille Bayala should have won it for Burkina Faso after an intelligent throughball from Nakoulma with 12 minutes left on the clock, but the attacker failed to beat Richard Ofori from inside the area, aiming straight at the Ghana goalkeeper.
But Burkina Faso were not to be denied and Alain Traore found the top corner with a stunning free-kick from a narrow angle.
Daniel Amartey could have restored parity well into stoppage time, only to send his header wide as Ghana had to settle for fourth place.