The injured Mohamed Salah watched from the stands as Egypt played out a crazy 2-2 draw with Cape Verde at the Africa Cup of Nations on Monday, a third consecutive stalemate that was enough to clinch a spot in the last 16.

Cape Verde had already secured first place in Group B and were on course to make it three wins from as many games when Gilson Tavares Benchimol put them ahead just before half-time at Abidjan's Felix Houphouet Boigny Stadium.

But substitute Mahmoud Trezeguet equalised five minutes after the restart and Mostafa Mohamed lobbed in a brilliant stoppage-time goal for Egypt which was confirmed after a VAR check ruled out a handball.

It was not the winner, with Bryan Teixeira scoring Cape Verde's second goal nine minutes into added time.

Yet by that stage the other Group B game had ended, and Ghana's 2-2 draw with Mozambique allowed Egypt to finish second with just three points.

Egypt, the record seven-time African champions who have not won the title since 2010, will now head to San-Pedro for a last-16 tie on Sunday.

However, Salah will miss that game and there are doubts as to whether the Egypt captain will be seen again in Ivory Coast.

The Egyptian Football Association announced on Sunday that he would return to Liverpool after this match to continue treatment on the hamstring injury he suffered in last Thursday’s 2-2 draw with Ghana.

They said he would return to the squad for the semi-finals should Egypt get that far, but the player's agent on Monday cast doubt on such a possibility.

"Mohamed's injury is more serious than first thought and he will be out for 21-28 days, and not two games," Ramy Abbas Issa wrote on X.

"His best chance at participating in the current AFCON is by undergoing intensive rehabilitation in the UK and rejoining the team as soon as he is fit."

The chances of Egypt getting out of their group appeared bleak when Cape Verde went in front right on the stroke of half-time as Ryan Mendes nodded the ball down for Benfica B team striker Benchimol to control, swivel and fire in.

Trabzonspor winger Trezeguet came on as part of a double substitution at the beginning of the second half as Egypt found themselves chasing the game, just as they had done in their two previous group outings.

He needed just five minutes to find a leveller, picking up possession following a corner and exchanging passes with Ahmed Hegazy before beating the goalkeeper from a difficult angle.

Mohamed then appeared to have won it three minutes into stoppage time when he controlled Trezeguet's long ball forward and beat Cape Verde goalkeeper Vozinha with a brilliant lob.

The referee needed to check the VAR monitor to be sure he had not controlled the ball with his arm, and the goal was given.

However, Teixeira then drove in to make it 2-2 as Cape Verde finished the group unbeaten before turning their focus to a last-16 tie in Abidjan on January 29.