Substitute Reza Ghoochannejhad scored an injury-time goal to lift Iran to a 1-0 win over UAE and top spot in Group C at the Asian Cup.
Despite a free-flowing game, and a virtuoso performance by UAE playmaker Omar Abdulrahman, neither side could find a breakthrough until Ghoochannejhad's late strike helped Asia's top-ranked team avoid a likely quarterfinal showdown with Japan.
UAE appealed for offside when Ghoochannejhad pounced on a ball that had ricocheted off teammate Andranik Teymourian and directed his header into the top corner from close range. However, television replays indicated the striker had just stayed onside.
Iran will now face the runners-up of Group D, likely to be Iraq or Jordan, in the quarter-final at Canberra on Friday, while the UAE now likely faces Japan in Sydney.
Meanwhile, in Sydney, Sayed Jafaar produced a stunning long-range strike in the 82nd minute to lift Bahrain to a 2-1 victory over Qatar for its first win of the tournament.