A draw against Tunisia in their closing first-round tie in Franceville on Tuesday will ensure the co-hosts top Group C, after wins over Niger and Morocco. Their reward would be a last-eight date with the Group B runners-up back in the Gabonese capital on 5 February.
Gabon coach Gernot Rohr said: "We want to avoid Ghana, so we would like to finish top. That would mean also playing our quarter-final in Libreville, in this wonderful L'Amitie stadium with its fantastic crowd.
"If we come in as runners-up we would have to go to Equatorial Guinea if we make it into the semi-finals. We will play Tunisia to win, but a draw will be sufficient as we have better goal difference than them."
These are heady days for a team ranked only 77th in the world and 16th in Africa. And Rohr cautioned: "We're not pretending to be Brazil, we're a very humble bunch, we have lots to improve, we have to keep our feet on the ground."
We're not pretending to be Brazil, we're a very humble bunch, we have lots to improve, we have to keep our feet on the ground.Gernot Rohr, Gabon coach
Gabon joined Equatorial Guinea and Côte d'Ivoire in the knockout stages in the most remarkable fashion last night. Morocco held the lead up to the 77th minute after captain Houssine Kharja's first-half goal.
But Gabon took command in the space of two minutes, with goals from Pierre-Emerick Aubameyang and former Hull City striker Daniel Cousin. The vociferous 40,000 crowd then fell silent in the first minute of injury time when Kharja coolly stepped up to level from the penalty spot.
But Gabon never gave up, with Bruno Mbanangoyes' curling in a free-kick in the final second of the eighth minute of stoppage time to settle an unforgettable encounter. "It was really dramatic watching this fantastic game from the touchline," said Rohr.
"I must say bravo to my players. I knew this team had mental qualities to produce such a performance, I hope they can do it again because they left a lot of energy out there.
"Now we go to Franceville to play Tunisia, a very big team. I worked in Tunisia, at Etoile du Sahel, I hope I will have a good time with my friends on Tuesday."