Ashkan Dejagah, striker for Germany’s Wolfsburg, scooped the first goal in the fourth minute of the match, but Khalfan Ibrahim equalized the match four minutes later from the penalty spot.
The Iranian-German represented his team well, scoring a brace on his home debut – he scored his second goal five minutes after the break, sending the ball past Qatar keeper Qasem Burhan.
With five minutes remaining, Majed Mohammad equalized the match for Qatar for a second time, heading the ball into the Iran’s net and booking Paulo Autuori’s team a place in the fourth round.
Bahrain also humiliated 10-man Indonesia 10-0 in a home game in Group E.
Wednesday's results meant that Iran secured top position in the group on 12 points, while Qatar finished second with 10.