Iran finished AFC U-20 Futsal Championship Qualifiers with the first place in Group A the following their 4-2 win at the Uzbekistan Stadium.
Both teams came into the deciding match with three points each - with Iran beating Turkmenistan 6-3, while Afghanistan cruised to a 5-0 victory.
Hamid Reza Hossaini put Afghanistan in front in the seventh minute but Iran equalised seconds later through Seyed Behdad Ahmadi.
2019 AFC U-20 Futsal Championship Qualifiers
Iran 4-2 Afghanistan
Salar Aghapour broke the deadlock in the 14th minute and Behdad Ahmadi made it 3-1 a minute later.
In the second half, Afghanistan fought back and made it 3-2 in the 26th minute after Seyed Hossein Mousavi found the net. But an own goal by goalkeeper Mohammad Javad Safari gave Iran a 4-2 advantage as they held on to win the tie.
Afghanistan finished second and can still earn their place in the 2019 AFC U-20 Futsal Championship when they meet Group B runners-up Tajikistan in the Central Zone play-off on Tuesday.