A 2-0 win would not have quite been enough for Mexico even before Salem Al Dawsari scored deep into stoppage time.
Mexico fell painfully short of the last 16 of the World Cup as a 2-1 win over Saudi Arabia at Lusail Stadium left them behind Poland on goal difference.
Salem Al Dawsari’s break sealed El Tri’s exit, although they were already on the way out with an even slimmer margin.
Until then, the sides were separated by a worse fair play record with Poland, which had already lost 2-0 to Argentina.
Mexico had two minutes left to add decisive third strikes in the second half from Henry Martin and Luis Chavez, but the goal they had been chasing for so long proved beyond them.
Tata Martino’s men may have paid the price for not getting more out of a dominant first half when they came closest when Mohammed Al Owais denied Alexis Vega in the third minute.
The second period initially went according to plan as Cesar Montes flicked a Chavez corner into the center of the box where Martin couldn’t miss.
One quickly became two thanks to a sensational Chavez free-kick, but Hirving Lozano and substitute Uriel Antuna saw potentially valuable goals ruled out for offside, leaving Mexico agonizingly short heading into the break.
After full-time against Poland, Al Dawsari came through to score an effort that ended up amounting to nothing, but it was a heartbreaker for Mexico.