Co-hosts Gabon defeated Tunisia 1-0 here Tuesday to finish top of Africa Cup of Nations Group A with a perfect nine points from three matches.
The Panthers will play the runners-up in Group D in Libreville on Sunday, while Tunisia, who finished second in the group will face the winners of Group D.
Pierre-Emerick Aubameyang gave Gabon the lead after 62 minutes when he collected a loose ball before wrong footing Tunisia goalkeeper Rami Jeridi for his third goal of the competition.
"This was our most difficult game so far against a very good Tunisia team, who dominated the game from start to finish," admitted Gabon coach Gernot Rohr after the match.
"It was not easy because we were already qualified for the quarterfinals. But thanks to the professional attitude and fighting spirit of the players, we won to finish top of the group."
Tunisia coach Sami Trabelsi said he rested several players -- goalkeeper Aymen Mathlouthi, skipper Karim Haggui, Khaled Korbi and Mejdi Traoui -- because they would have been suspended for the quarter-finals had they been booked.
"We rested some of the players because they have already been booked and we did not wish to risk them before the quarterfinals," said Trabelsi.
"However, those who played today showed many good qualities because we played well but we could not win the match."
Skipper Daniel Cousin could have doubled the co-hosts? lead in the 67th minute but his shot from a rebound was well off target as Gabon seemed to be a revived team after the recess.
The north Africans fought to restore parity but the home team were resolute in defence to hold on for another famous victory.
All the same, the 2004 champions played with ease despite the wet conditions at the Franceville Stadium and after seven minutes Youssef Msakni fired a low drive from distance which was cushioned by Gabon goalkeeper Ovono.
The Carthage Eagles continued to attack their opponents with Aymen Abdennour coming close after 22 minutes with a header off a corner kick as Gabon struggled to put together a decent attack.
It was not until the 25th minute that Gabon had a clear sight on goal when Roguy Meye headed wide of the mark as goalkeeper Jeridi came out to catch a long ball inside his box.
Andre Poko then tried another shot from distance three minutes later, but it was always going wide and never troubled the Tunisia goalkeeper.
In the 36th, Meye somehow got the better of his marker Abdennour on the edge of the box, but the header by Poko off his cross was not well directed at the Tunisia goal.
Soon after Bruno Zita blasted his free kick wide after Cousin was fouled around the left hand corner of the Tunisia goal area.
In first half stoppage time, the co-hosts came closest to opening the scoring when Aubameyang?s low cross was not properly cleared by the Tunisia defence and from the loose ball Cousin scuffed his shot wide from 10 yards.