Al Ain came back from three goals down to draw 3-3 with Team Wellington and then won 4-3 on penalties in a dramatic first round match at the Club World Cup on Wednesday.
Al Ain goalkeeper Khalid Eisa saved two penalties in the shootout to earn his team a second round tie against African champions Esperance, of Tunisia, on Saturday.
Team Wellington, the Oceania champions, got off to a flying start when Mario Barcia scored with a dipping long-range shot in the 11th minute and Aaron Clapham finished off an incisive passing move for the second four minutes later.
Al Ain had a 36th-minute goal disallowed by VAR for a foul in the buildup and things went from bad to worse for Al Ain as Mario Ilich added a third for the semi-professionals in the 44th minute, tapping in unmarked at the post from a corner.
But the New Zealanders allowed the hosts to get a morale-boosting goal on the stroke of half-time, Tsukasa Shiotani slotting home after the defence had failed to clear.
Al Ain coach Zoran Mamic said that proved the turning point.
"It was really hard to come back, thank God we scored in the first half," he said. "That goal gave us some spirit and some chnace to come back in the second half."
Tongo Doubmia further reduced the deficit when he turned in a cross at the far post four minutes after half-time and Al Ain, who qualified as champions of the host nation, took control.
Al Ain, playing at their home Hazza Bin Zayed Stadium, dominated the second half as Wellington appeared to run out of steam and Marcus Berg headed over from an inviting position but made amends as the Sweden international hooked in the equaliser in the 85th minute.
Al Ain's Mohamed Abdulrahman was sent off just before the end of extra time after being shown a second yellow card for a foul on Wellington's Taylor Schrijvers.
Berg missed Al Ain's second penalty in the shootout, firing wildly over, but his blushes were spared when Eisa saved Angus Kilkolly's next attempt for the New Zealanders and also parried Justin Gulley's final kick to seal victory.
Despite the heartbreaking defeat, Wellington coach Jose Figueira said he was proud of his team.
He said: "As amateur players so far away from home and in an atmosphere which is very different to what we are used to, to put on a performance like this is almost beyond expectation."
The winners of Saturday's clash between Al Ain and Esperance will face South American champions River Plate in next Tuesday's semifinal.
The second semifinal will be between favourites Real Madrid and the winners of Saturday's other second-round tie between Asia's Kashima Antlers and Mexican side Guadalajara, the champions of CONCACAF.