Two late goals by Iran in stoppage time, completing a 2-0 victory, have left Wales' World Cup hopes hanging by a thread.
It came after Wales goalkeeper Wayne Hennessey was shown a red card late in the match.
He came steaming out of his penalty area and missed an attempted clearance, clattering Iranian striker Mehdi Taremi in the process.
Initially given a yellow card, following a VAR check after protests from the Iranian team, Guatemalan referee Mario Escobar changed his mind and sent the Welsh goalie off the pitch, reducing the Welsh side down to 10 men.
The defeat leaves Wales at the bottom of Group B. Their next match is against England on Tuesday, who face USA later tonight.
The Welsh side had described it as a must-win game after drawing against the USA.
Wales will now have to beat England in the final group game to be in with a chance of reaching the knockout stages of the Qatar World Cup - something they have not achieved since 1958.
Iran's hopes of qualification remain alive after today's win.
Rob Page's team were rattled at times during the match, with Iran continuously issuing reminders of the danger they posed.
Iran hit the post twice before goalkeeper Hennessey pulled off a quick-reaction save to keep the score level.
Wales rarely tested the Iranian defence, and appeared to be relying on another moment of magic from captain Gareth Bale.
They came closest when a shot from Ben Davies in the 83rd minute was tipped over by Iran's goalkeeper Hossein Hosseini.
The introduction of Daniel James and Brennan Johnson gave Wales more attacking potency, but Iran still looked a threat at the other end and after Hennessey's sending off, they capitalised on their one-man advantage.
'It's gutting, we're gutted'
Wales captain Gareth Bale told the BBC: "It's gutting, we're gutted. There's no other way to say it.
"We fought until the last second but it's one of those things, it's difficult to take, but we have to recover and go again."
Page said: "Our performance before the red card was not acceptable. We hoped it would all come together today, but we were nowhere near the levels we've set and the standards we've set in recent games.
"One or two you can carry, but when there are so many off days there is only one outcome.
"I always take responsibility, that's my team, the sending off didn't help of course but at that point we had five forwards on the pitch so couldn't get a defensive shape.
"But yes I'll always take responsibility for performances. It's a difficult changing room at the minute but we will be ready [against England], it's a local derby and a great game to finish on and we'll be prepared to go."
Ticketing problems and Iranian protests
Much of the focus was on off-field matters ahead of kick-off, with fans encountering more ticketing problems as they attempted to enter the stadium, and confrontations between Iranian regime supporters and protesters.
Iran's national anthem was met with loud jeers inside the ground - but the Iranian team this time did sing it, having refused to during their World Cup opener against England.
Their silence was viewed as a show of unity for mass anti-government protests in their country.
Today, though lacking in gusto, they decided not to remain silent.
Despite their heartbreak at the result, pre-kick off, Wales fans celebrated being allowed to wear rainbow bucket hats and take rainbow flags to today's game.