On 4 June 2016, El Hadary played the full 90 minutes in a 2–0 win against Tanzania which secured Egypt's qualification for 2017 Africa Cup of Nations. On 17 January 2017, two days after his 44th birthday, he became the oldest player to ever appear in an Africa Cup of Nations match after replacing Ahmed El-Shenawy in Egypt's first match of the tournament.