Pierre-Emerick Aubameyang scored his third goal in as many games as co-hosts Gabon confirmed top spot in Group C with a 1-0 win over Tunisia in the Africa Nations Cup in Libreville.
Aubameyang scored the only goal of the game in the 62nd minute to ensure his nation will stay in their capital city for the quarter-finals. Tunisia, as runners-up in the group, will also qualify.
Morocco registered their first victory in the tournament - a 1-0 win against Niger - but it did little more than restore some pride as they exited the competition along with their Group C opponents in Libreville.
Both sides had lost their first two matches, meaning this encounter was a dead rubber, and so it was no surprise the match lacked real incident.
Younes Belhanda's goal 11 minutes from time proved decisive, the Montpellier midfielder converting a pass from Arsenal forward Marouane Chamakh.
It meant Niger's debut in the tournament ended with just a single goal and no points from their three games.