Hosts Qatar battled through along with Uzbekistan into the Asian Cup quarter-finals on Sunday on a night of high drama which saw perennial under-achievers China crash out.
The unbeaten Uzbeks squandered a 2-1 lead before settling for a nervy 2-2 draw with China to seal top spot in Group A while Qatar saw off Kuwait 3-0, ensuring both sides joined already-qualified Iran in the last eight.
China -- who were in with a shout of qualifying going into the final game -- finished third and Kuwait last.
Qatar and Uzbekistan will next play one from Japan, Jordan and Syria of Group B, on Friday.
The placings for that group will be decided on Monday, with the Uzbeks playing the team that finishes second and Qatar playing the group winner. Japan, one of the tournament favourites, currently top the group.
Qatar stormed into the quarter-finals for only the second time in their history with a commanding performance.
Captain Bilal Mohammed got the opening goal on 11 minutes at the Khalifa Stadium after a blistering start from the 2022 World Cup hosts with Mohamed El Sayed scoring the second five minutes later.
Brazilian-born substitute Fabio Cesar put the game beyond doubt four minutes from time with a beautifully weighted free-kick that left the goalkeeper stranded.
It capped a remarkable comeback by Qatar, who lost their opening match to the Uzbeks 2-0 then rebounded to beat China by the same scoreline.
For Kuwait, it was a reality check after they won the West Asian Football Federation Championship in October on their maiden appearance then followed it up by lifting the Gulf Cup last month.
They head home with three defeats out of three, although coach Goran Tufegdzic's job appears to be safe.
The other deciding game on the night was a topsy-turvy affair at the Al Gharafa Stadium.
Having fallen behind early on, Uzbekistan equalised and then went ahead early in the second period through a fine long-distance effort from one-time CSKA Moscow forward Alexander Geynrikh.
Schalke midfielder Hao Junmin brought the East Asian champions level with a magnificent free-kick but despite sustained pressure China could not find a winner that would have brought qualification down to head-to-head records.
Yu Hai had given China the lead in the sixth minute, in front of a disappointing crowd of just 3,529, with Odil Akhmedov replying for Uzbekistan.
Despite China's best efforts there was to be no late drama and amid the tension in the closing stages, coach Gao Hongbo's complaints about Uzbek time-wasting saw him sent to the stands.