Javier Balboa's penalty and a second goal from Iban Edu saw hosts Equatorial Guinea claim a 2-0 win over Gabon on Sunday and book a place in the quarter-finals of the African Nations Cup.
Balboa blasted home from 12 yards after he was fouled in the penalty area by defender Lloyd Palun, while Gabon missed a number of excellent opportunities to get the point they needed from the game to advance to the next stage.
Edu added a second five minutes from time to seal the win and send the Bata crowd into delirium.
Equatorial Guinea finish second in Group A behind Congo, who defeated Burkina Faso 2-1 in the other game in the pool, and now face a Last 8 game against the top team in Group B in tiny Ebebiyín.
For Gabon it is a bitterly disappointing end to a tournament that started with such promise following a 2-0 success over the Burkinabe in their opening match, which had many suggesting they could be Dark Horses for the title.
But it is also typical of their fortunes in recent times. It is a side that blows too hot and cold and does not have the consistency in their performance to go deep into tournaments.
The home side nearly hit the front when Balbao's early cross along the ground almost reached Fabiani Bosio at the far post, but Gabon were able to clear.
At the other end Guinea goalkeeper Felipe Ovono denied Gabon's star, Pierre-Emerick Aubameyang, who got a powerful header on target.
Ovono then made another fine stop to deny Andre Biyogo from close range as the teams went into halftime locked at 0-0.
The home goalkeeper then got his fingertips to a fine, dipping free-kick from Frederic Bulot to keep Gabon at bay and two minutes later Guinea had a penalty. Balboa danced into the penalty area and drew a rash lunge from Palun, before tumbling to the turf.
There was contact in the challenge, but Balboa initially looked as though he would keep on running before a rather delayed fall to the floor.
Although the forward made the most of the contact, there could be little argument that it was a spot kick and Balboa blasted home from 12 yards past Gabon keeper Didier Ovono.
Gabon should have been level just before the hour-mark when Aubameyang's cross reached Bulot at the back-post, but with the goal gaping in front of him he somehow contrived to put the ball over the bar.
After Balboa had missed a one-on-one chance by shooting straight at the goalkeeper, it was 2-0 when Edu knocked home the rebound after Emilio Nsue's shot was saved after a cross from Balboa.