Morocco were eliminated from the African Nations Cup as their campaign ended after a goalless draw with Libya whose own hopes of progressing had already been dashed before kick-off.
Even if Morocco had seen off their opponents they would have failed to progress with Egypt beating Ivory Coast 3-1 in the other match played simultaneously across the city.
The Ivory Coast had already qualified but Egypt's victory ensured the Pharoahs win Group A with the Elephants forced to settle for second place.
Victory for the Ivorians would have given Morocco the chance to progress to the quarter-finals if they had managed to see off Libya but it was not to be.
Morocco were runners-up to Tunisia in the last African Nations Cup and were also pipped to a place in the World Cup by the Carthage Eagles.
They had hoped to atone by winning the African Nations Cup but now the Atlas Lions clearly have a major rebuilding job to do if they are to reclaim some of their former football glory.
The first chance of the match fell to Libya but Nader Karra's shot was wide of the mark.
Morocco could have opened the scoring after nine minutes when Youssef Safri played in a free-kick towards Nourredine Naybet.
However, the veteran defender could not direct the ball on target and the chance went begging.
The Atlas Lions came even closer to breaking the deadlock when Mohammed El Yagoubi struck the post with a left-footed effort from the edge of the box.
Houssine Kharja and Talal El Karkouri also went close as the Moroccans took control.
Another chance fell their way after 35 minutes but Hicham Aboucherouane totally miscued his shot.
Shortly before the interval, Libya goalkeeper Ruben Luis Alejandro did well to beat out another free-kick from Safri.
In the second half, Morocco were also quick to impose their game on the Libyans but still found goalscoring chances hard to come by.
Aboucheroune centred towards Youssouf Hadji who failed to get his header on target.
Morocco's mood deteriorated as news came through that Egypt were beating the Ivory Coast across Cairo and the game started to deteriorate as a spectacle.
A series of petulant challenges from both sides marred the match but substitute Ali Boussaboun's low shot forced Alejandro to make a good save at his near post.
In a rare Libyan raid, Karra made a dashing run down the left and centred but with Morocco goalkeeper Tarek Jarmouni stranded no Libyan was able to get a decisive touch.