Jordan advanced to the Asian Cup quarter-finals after two stoppage-time goals secured a 3-2 win over Iraq, who had striker and tournament top scorer Aymen Hussein sent off late on for excessive goal celebrations.
With Iraq looking destined to move into the last eight when the clock struck 90 minutes, Jordan's Yazan Al-Arab equalised in the 95th before Nizar Al-Rashdan scored two minutes later with a glorious long-range effort to break Iraqi hearts.
Jordan went ahead on the stroke of halftime when Yazan Al-Naimat pounced on a sloppy pass and raced past the defence.
The 24-year-old chipped the ball over goalkeeper Jalal Hassan to score before celebrating with his team mates by sitting on the turf and pretending to eat a meal.
Iraq struck back in the 68th when Saad Natiq headed home from a corner before Hussein scored eight minutes later when he controlled a cross and fired into the bottom corner.
The joy of scoring his sixth goal of the tournament quickly turned to shock when the referee produced a second yellow card for excessive celebrations after the striker mimicked Jordan's players and sat on the turf, pretending to eat by himself.
While Iraq fumed, Jordan took full advantage of the extra man and when Mousa Tamari's stoppage time effort was parried by Hassan, Al-Arab was on hand to fire home the rebound.
The comeback was complete when midfielder Al-Rashdan was left unmarked outside the box and curled his shot past the keeper to set up a quarter-final with tournament debutants Tajikistan, who overcame the UAE 5-3 on penalties on Sunday.