Oman and Turkmenistan looked set to be eliminated with a 1-1 draw, but two late goals sent the Gulf Cup champions through in the Asian Cup.
Mohammed Al-Musallami guaranteed Oman's place in the last 16 of the Asian Cup with a last-gasp goal sealing a 3-1 victory over Group F rivals Turkmenistan.
The two teams appeared set to be eliminated with the scores locked at 1-1 after 83 minutes at Mohammed Bin Zayed Stadium, but Muhsen Al Ghassani and Al-Musallami got the goals they needed to advance as one of the best third-placed teams.
Oman took the lead in the 20th minute through a sensational free-kick from Ahmed Al Mahaijri, but Altymyrat Annadurdyyev drew Turkmenistan level before half-time.