Ezatolahi smashed through David de Gea's legs following a scramble in the goalmouth, but the flag was quickly raised.
Unfortunately for Iran, they did not see this, and they were some way into their celebrations over by the corner flag before the team and their coaching staff were made aware that the goal would not stand.
What followed was a brief but agonising wait to see if the decision was correct - it was.
The replays conclusively showed that the ball had ricocheted off an Iranian player who was in an offside position, not that he could have known much about it, and the correct decision was given.
However, it was a worry for Spain, who have looked shaky in defence and must surely improve if they are to go deep in the tournament.