The Panthers opened the score thanks to a goal by Jim Allevinah (22nd), while the Atlas Lions equalized following a penalty kick taken and converted by Sofiane Boufal (74th). In the 81st minute, Aaron Boupendza gave the lead back to Gabon. Three minutes later, Achraf Hakimi set the record straight with a superb free kick.
Morocco finished first in the group with 7 points, ahead of its opponent (5 pts). Morocco and Gabon are qualified for the round of 16.
In the other game of this group, the Comoros Islands (3rd/3 pts) achieved their first victory in the final phase of the CAN at the expense of Ghana (3-2). The Black Stars close the group (1 pt) and leave the tournament.