Iran’s ‌hopes of reaching the World Cup knockout phase for the first time came to ⁠an agonising end after Austria’s last-gasp equaliser against Algeria left them outside the tournament’s eight best third-placed teams.

Amir Ghalenoei’s side completed their Group G campaign on Friday with a ⁠1-1 draw against Egypt, leaving them waiting to discover on ⁠Saturday whether three points would be enough to earn a spot in the round of 32 .

Iran had already endured one major setback when a stoppage-time ⁠winner against Egypt was ruled out for offside.

That left them needing other results in group stage matches to go their way, and for a few minutes on Saturday, it looked as if Iran were going to squeeze through when Algeria struck in stoppage time to achieve a 3-2 lead over Austria.

However, the Austrians equalised with ‌almost the final kick of the game, salvaging a 3-3 draw that sent both teams through and denied Iran a place in the knockouts in their seventh World Cup appearance.

Iran departs the tournament unbeaten after draws with Belgium, New Zealand and Egypt in a challenging campaign due to myriad issues off the pitch .

Uncertainty over visas and the US-Israel war on Iran meant the team had to commute from their tournament base in cohosts Mexico for their three group games ⁠in the United States.

US authorities required them to enter within 24 hours ⁠of a match and leave the same day although those restrictions were eased slightly for their final game in Seattle, where they were allowed to arrive two days before the game.

US President Donald Trump said in March that ⁠Iran were welcome to participate in the World Cup but he did not believe it was appropriate for them to be in the US “for their own life and safety”.

After the draw with Egypt, ⁠captain Mehdi Taremi described the situation as a logistical “disaster” and questioned whether his team were truly welcome at the tournament.

“Who wants to help us?” Taremi asked reporters. “If they want us to be out, OK, let’s be out. But that’s not fair.”

Key ‌members of the delegation were unable to join the squad in the US, and coach Ghalenoei said his team were being “ oppressed ”.

Ultimately, Iran’s campaign came down to moments.

Had Taremi scored ‌a ‌first-half penalty against Egypt or had his header hit the net instead of the crossbar later on, Iran might have been looking forward to a knockout match for the first time.