Ghana drew 1-1 with Guinea here Wednesday to finish top of Group D and qualify for the Africa Cup of Nations quarterfinals.
The Black Stars garnered seven points from three matches, while Mali also joined them in the last eight after they beat Botswana 2-1 in the other Group D match in Libreville.
Mali have six points, while Guinea crashed out of the competition on four points. Botswana finished pointless.
On Sunday, Ghana will tackle Tunisia in one of the quarterfinals, while co-hosts Gabon take on Mali in the other in Libreville.
Against the run of play, Ghana went in front in the 28th minute through Emmanuel Badu with an unstoppable belter from outside the box.
He collected a short corner taken by Andre Ayew and from 20 yards he let fly to give goalkeeper Naby Yattara no chance.
It was Ghana?s 100th goal at the Africa Cup of Nations.
Dashing left winger Abdoul Razzagui Camara drew Guinea level in first half stoppage time when his left-footed floater beat Ghana goalkeeper Adam Kwarasey.
Guinea were reduced to 10 men after Bah Dioulde was sent off after being booked for second time for a cynical foul on John Pantsil.
Before the late rally by Ghana, Guinea controlled play as they chased an early goal.
They first threatened through the lively Camara after just three minutes. Ibrahima Traore too gave Masahudu Alhassan some concern on the right flank as Guinea stayed on the front foot.
On 10 minutes an appeal for a Guinea penalty after Traore appeared to have been brought down by Kwarasey inside the 18-yard box was ignored by the referee.
Guinea continued to put pressure on Ghana and on 20 minutes, new Nantes signing Ismael Bangoura?s cross from the right turned away for another corner to the Syli National.
In 23rd minute, Guinea striker Sadio Diallo missed with header from a corner and two minutes later, the dangerous Traore put the ball in the Ghana net but his effort was rightly ruled offside.
Ghana launched a late rally in the final minutes of the first half.
South African referee Daniel Bennett turned a blind eye to a penalty appeal by Ghana in the 40th minute after Asamoah Gyan had been pushed down by Guinea skipper Kamil Zayatte inside the box.
Ghana?s Samuel Inkoom also came close to scrambling home a rebound after some determined work by Gyan in the closing moments of the first half.
Eight minutes after the break, Kwarasey saved off the feet of Bangoura as the game opened up with both sides no longer hiding their attacking intentions.
On the hour, Diallo fired wide off a corner even when he was well positioned inside the goal area as Guinea stayed in the hunt for another goal.