He was chosen by Héctor Cúper for the squad to play the 2017 Africa Cup of Nations,[60] where he was a regular in the team's starting lineup; he helped his nation to reach the final of the tournament, losing 2–1 against Cameroon.[61] He later credited Cúper for his improved form in the Cup of Nations and qualifying matches for the 2018 FIFA World Cup, where he came on as a substitute during his country's decisive qualifying victory over DR Congo,[62] stating "He is a coach who respects those who exert efforts in training and matches."[63] In May 2018, he was named in Egypt’s preliminary squad for the 2018 World Cup in Russia.[64] After being included in the final 23-man squad, he started all three of Egypt's group matches, defeats to Uruguay, Russia and Saudi Arabia, as they were eliminated in the group stage.[59]