While Comoros might not qualify as one of the best third-placed teams, they have earned the right to hold their heads high, finishing above a poor Ghanaian team.
Comoros take the lead, Ayew sent off in frantic first-half
Comoros set the tone for the match when they took a shock lead in the fourth minute through their striker and captain El Fardou Ben.
The goal sent their fans in the stadium into delirium, seeing the team score their first-ever goal at the AFCON finals.
Ghana then went on a siege of the Comoros goal, having a ball cleared off the goalline in the 8th minute.
For his unchecked enthusiasm, Andre Ayew got into trouble in the 24th minute when he recklessly challenged Comoros goalkeeper, Ben Boina.
The former Swansea City forward was shown a straight red card for reckless play while the Comoros goalkeeper was stretchered off and replaced by 30-year-old Ali Ahamada.
The Comoros side sought to make their numerical advantage count, creating overloads on the wings against the Ghanaians.
The Ghanaian coach Milovan Rajevac looked shell-shocked on the touchline as his side battled to find an equaliser before the end of the first half.
More drama as Comoros win despite Ghanaian fightback
At the beginning of the second half Ghana tried to keep possession of the ball and control the tempo, playing quick passes in an attempt to catch Comoros on the break.
However, it was the minnows that would double their lead soon after with Ahmed Mogni firing home a clean strike from the edge of the box in the 61st minute.
Ghana pulled one back immediately after in the 64th minute through substitute Richmond Boakye after Comoros goalkeeper Ahamada had flopped his lines coming for a corner-kick that he totally missed.
The Black Stars kept pushing till they found the equaliser in the 77th minute. Alexander Djiku pounced on a loose ball from another corner-kick to lash home the ball.
But the drama did not end there with Mogni grabbing his second of the night in the 85th minute to condemn Ghana to a loss on the night.
The group's other match between Morocco and Gabon was as pulsating as this also with the North Africans coming from behind twice to snatch a 2-2 draw against The Panthers.
The results mean Morocco and Gabon secure qualification for the Round-of-16 while Comoros finish third with Ghana in the last position after the Black Stars failed to win any game at this tournament.