(CNN) -- Tunisia and co-hosts Gabon secured dramatic last-gasp victories to reach the quarterfinals of the Africa Cup of Nations Friday. Tunisia needed a final minute goal from Issam Jemaa to beat Niger 2-1 while Gabon came from behind to beat Morocco 3-2 with their winner in the eighth minute of added time. It left them tied on six points and assured of a place in the last eight, while Morocco and debutants Niger are going home and are pointless with a match to play in Group C. The first game in Libreville saw Niger put up a brave challenge and Tunisia coach Sami Trabelsi was relieved by his team's victory.
@highlight
Tunisia and Gabon secure second wins in Africa Cup of Nations Group C
@highlight
Last minute goal from Issam Jemma gives Tunisia 2-1 win over Niger
@highlight
Co-hosts Gabon later beat Morocco 3-2 to join Tunisia in last eight
@highlight
Bruno Mbanangoyes grabs dramatic winner for Gabon in stoppage time
@placeholder had the better chances to win the match, but a point was cruelly snatched from them by Jemaa's late strike.