Hosts Azerbaijan moved a step closer to a spot in the semi-finals due to a 2-0 win over Saudi Arabia in the second game of Group A in the Islamic Solidarity Games football tournament on Thursday.
Goals from Elshan Abdullayev in the 67h minute and Aghabala Ramazanov 13 minutes later were just what was needed for the locals to knock out a good but inexperienced Saudi side.
With four points, Morocco and Azerbaijan head into the final day of the group stage needing just one point to secure qualification for the semi-finals.
The Indomitable Lions of Cameroon can still book a ticket for the last four but will need to beat the Saudis who, with two straight defeats, are already out of the tournament.
In the opening minutes, the Green Falcons were clearly the superior side with the deft Hassan Alamri running amok on the right wing, but striker Abdulrahman Alghamdi, captain Mohamed Kanno and playmaker Mohammed Alkuwaykibi all failed to find the target following his raids.
The many defensive mixups in the Azeri back four didn't help reassure the partisan crowd at Baku's Bayil Stadium, which accompanied its rhythmic chanting of "Azer-bai-jan! Azer-bai-jan!" with thumping drumbeats.
For the locals, Mahir Madatov was the main threat and Aghabala Ramazanov the spark but neither of them were able to seriously trouble a solid Saudi defence.
The second half started with more of the same as Saudi Arabia dominated and the hosts counter-attacked.
But Madatov and Ramazanov failed to convert their chances with the former hitting straight at the keeper in a one-on-one that could have changed everything.
Habib Alwatyan also denied pacey Azar Salahli and Elshan Abdullayev as Azerbaijan piled on the pressure in a windy final quarter of the game.
With 23 minutes left Abdullayev finally broke the deadlock with a cracker from outside the box before Ramazanov added a killer in the final ten minutes.
Monday's final action in the group stages sees Cameroon go head to head with Saudi Arabia while hosts Azerbaijan take on Morocco with two tickets for the semi-finals still up for grabs.