BATA, Equatorial Guinea (AP) — Host Equatorial Guinea advanced to the quarterfinals at the African Cup of Nations after coming alive in the second half to eliminate Gabon with a 2-0 win in their last group game on Sunday.

Javier Balboa won a penalty and converted it in the 55th minute as Bata Stadium erupted. Substitute Iban Edu added a second in the 86th minute to make sure.

"It's magnificent," said Equatorial Guinea coach Esteban Becker, who took over the team barely a week before the tournament kicked off.

Equatorial Guinea's equation was simple heading into the final round of Group A games: A win would guarantee it progressed.

But Gabon was the better team in the first half, with forwards Pierre-Emerick Aubameyang and Frederic Bulot both denied clear opportunities by Equatorial Guinea goalkeeper Felipe Ovono.

Equatorial Guinea was full of life in the second half and Balboa and Edu provided the finishing touches. Balboa won the spot-kick when he surged into the penalty area and appeared to be brought down by Lloyd Palun. Balboa swept the penalty high into the net and the entire bench emptied to rush over and celebrate with him.

As Gabon pushed for the draw that would change everything and see it through at the expense of the host, holes began to appear in its defense. Balboa had another chance to score when he was clear on goal in the 77th. Gabon keeper Didier Ovono temporarily kept his team in it with a sprawling save.

The Gabonese really threw caution to the wind in the last 10 minutes and Edu eventually profited as he pounced on a rebound to poke home from in front of goal and raise a deafening roar from the crowd.

That ensured the team matched the achievements of three years ago when it co-hosted the tournament with Gabon and surprisingly made the quarters.

This was perhaps more of a surprise considering the little time Argentine coach Becker had to work with the young team and the quality of the opposition in Gabon — which has players in some of the top leagues in Europe.

"We played with our weapons," Equatorial Guinea's Juvenal Edjogo-Owono said. "Gabon is a team with a lot of quality. We played our match and we won, and I think we deserved it."

One of those Gabonese stars, German-based striker Aubameyang, should have scored in the 20th as he met a cross from the left with a powerful header, only for Ovono to push it past the post. Bulot was denied by another sharp stop by the Equatorial Guinea keeper, who plays semi-professional football in the local league.

Gabon ultimately paid a big price for those missed chances, although coach Jorge Costa said he didn't believe the game-turning penalty should have been given.

"A penalty that is not a penalty," he said. "A mistake that changed the game and we are flying back to Gabon tomorrow."