In an end-to-end game, Almoez Ali grabbed the winner for Qatar in the 82nd minute while Iran lost Shojae Khalilzadeh to a late red card in stoppage time as Iran coach Amir Ghalenoei lost for the first time since he took charge last year.
Iran wasted no time in getting on the board when Qatar failed to deal with a long throw-in and Sardar Azmoun scored with an overhead kick to give Ghalenoei’s side a third-minute lead.
Iran constantly got in behind Qatar’s defence but it was the hosts who equalised against the run of play when Jassem Gaber’s shot from range took a deflection and looped over goalkeeper Alireza Beiranvand into the net.
Qatar’s Akram Afif nearly made it 2-1 when the ball fell to him and he raced away with Iran’s defenders giving chase but his shot was well saved while his effort from the rebound went over the bar.
But Afif got his fifth goal of the tournament on the stroke of halftime when he waltzed into the box from the left channel and pulled the trigger to beat Beiranvand with a shot that arrowed past his outstretched hand into the top corner.
However, Iran came out with renewed vigour for the second half and won a penalty for a handball after a VAR check when Saeid Ezatolahi shot straight at Ahmed Fathy, who was trying to protect his face and turn away.
Having scored a late winner from the spot against Japan in the quarter-final, Alireza Jahanbakhsh stepped up once again and fired his spot kick straight down the middle to make it 2-2.
Iran had their chances to score a third through some chaotic moments in the box but it was Qatar who took the lead again when Ali controlled a pass, turned and fired into the bottom corner.
With 13 minutes added on for stoppages, Iran were then reduced to 10 men when Khalilzadeh barged into Afif during a counter-attack, with the referee upgrading his yellow card after a VAR check.
Jahanbakhsh nearly equalised right at the death but saw his shot come off the post as Qatar managed to hold on and advance to the final.