Iran did have a couple of good moments against England, and they were both provided by striker Mehdi Taremi.
The Porto man smashed one goal past Jordan Pickford to make it 4-1, and later won and converted a penalty late in added time to lend a little more respectability to the scoreline.
He would be in the thick of things again against Wales.
Needing at least a draw to avoid crashing out of the World Cup after two matches, Iran came out with guns blazing.
They had a goal disallowed in the 15th minute, and early in the second half saw two efforts clatter off the posts of the Welsh goal within about 10 seconds.
As the game looked to be fizzling out into a goalless draw, Taremi made a threatening run onto a long ball forward that drew out Welsh goalkeeper Wayne Hennessey.
Hennessey floored Taremi dangerously and became the first player sent off at this year’s World Cup.
Taremi, fortunately, did not look worse for wear, and in injury time, Iran seized their opportunity.
Rouzbeh Cheshmi struck first in the eighth minute of added time, putting Iran 1-0 up with a thunderous effort from outside the box.
And then there was Taremi again.
In the 11th minute of added time, he picked up the ball inside his own half to start a counterattack against the undermanned Welsh and ran with it before offloading it to Ramin Rezaeian.
Rezaeian calmly dinked the ball over substitute goalkeeper Danny Ward to seal the victory.
Iran ultimately missed out on qualification for the round of 16 after a 1-0 loss against the United States, but finished a creditable third in their group.
Video: Iran beat Wales 2-0 with last-gasp goals
Video not visible outside of Singapore due to limited rights.