In June 2018, at the age of 45, he was named in Egypt's 23-man squad for the 2018 FIFA World Cup in Russia. He was the oldest of all players selected for the tournament, beating the record set by Colombian goalkeeper Faryd Mondragón in the previous edition of the tournament. On 25 June, El Hadary was handed a start in Egypt's final group match against Saudi Arabia to become the oldest player ever to play in and debut at a World Cup at the age of 45 years and 161 days, once again breaking Mondragón's record of 43 years and three days. El Hadary stopped a penalty kick in the first half of the match, but subsequently conceded from a second penalty just before half time; his team eventually lost the game 2–1 after conceding a late goal in stoppage time.