The African Nations Cup provided a double helping of last-minute drama Friday as Tunisia beat Niger 2-1 and co-hosts Gabon stunned Morocco 3-2 to reach the quarterfinals. Substitute Bruno Zita Mbanangoye curled in an exquisite free kick in the fifth minute of stoppage time to give Gabon a shock 3-2 win over Morocco, eliminating one of the pre-tournament favorites. Tunisia's win also came from a substitute as Issam Jemaa gave it a 2-1 triumph over Niger who was knocked out. Tunisia and Gabon have six points each from two games in Group C while Morocco and Niger are pointless. Despite missing big guns such as Nigeria, Cameroon and Egypt, the tournament is turning into one of the liveliest in recent years and has yet to produce a one-sided match. Equatorial Guinea, the other co-host, qualified in similarly dramatic circumstances Wednesday, a 94th-minute goal giving it a 2-1 win over Senegal and a place in the last eight. The dullest football has come from Ivory Coast who did the absolute minimum to win its opening games against Sudan and Burkina Faso. In the second game of Friday's double bill, Houcine Kharja gave Morocco a 24th-minute lead, which it kept until an astonishing last 15 minutes. Just as he did in its 2-0 win over Niger, Gabon's inspirational striker Pierre-Emerick Aubameyang scored one goal and created the second. The Mohican-sporting St Etienne player rifled in an unstoppable volley to equalize in the 77th minute and two minutes later set up Daniel Cousin to score with a clinical finish. The former Rangers, Hull City, Larissa and Le Mens player collected the ball with his back to goal, spun and placed his shot just inside the far post, prompting some celebrating fans to run on to the running track around the pitch. The stadium was in raptures until Morocco, coached by former Belgium defender Eric Gerets, was awarded a penalty for handball against Charly Moussono in the 89th minute and Kharja converted for his second goal of the game. It was not over as Dinamo Minsk midfielder Mbanangoye's free kick curled over the wall and inside the near post to clinch the game and send Gabon to the last eight for only the second time. It also provided some poetic justice as the foul was awarded for a dreadful tackle by Mehdi Benatia who escaped with a yellow card when he should have been sent off. The opening match quickly came to life with two goals in the opening seven minutes, one of them sublime and the other bizarre. Tunisia's left winger Youssef Msakni dribbled past four defenders before placing the ball past goalkeeper Daouda Kassaly after four minutes. Niger was soon level when a long clearance into the Tunisia penalty area dropped with awkward back spin, fooling keeper Aymen Mathlouthi who was distracted by an attempt from Moussa Maazou to slap the ball which bounced on to the head of William Tonji Ngounou and into an empty net. The chances continued to flow, both teams hitting the woodwork, before Jemaa won it on the stroke of fulltime after cutting inside two defenders to power the ball home from close range.