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 stoppage-time consolation sealed El Tri's elimination, although they were already on their way out by an even finer margin.
An inferior fair play record to Poland, who had already lost 2-0 to Argentina, was set to separate the sides until that point.
Mexico still had two minutes in which to add a decisive third to second-half strikes from Henry Martin and Luis Chavez, but the goal they had chased for so long proved beyond them.
Tata Martino's men perhaps paid for not making more of a first half they dominated, going closest when Mohammed Al Owais denied Alexis Vega in the third minute.
The second period initially went according to plan as Cesar Montes flicked Chavez's corner into the centre of the six-yard box, where Martin could not miss.
One quickly became two thanks to a sensational Chavez free-kick, but Hirving Lozano and substitute Uriel Antuna saw potentially precious goals ruled out for offside, leaving Mexico agonisingly short heading into stoppage time.
Full-time in the Poland match was followed by Al Dawsari strolling through to net an effort that ultimately meant little but felt like a heartbreaker for Mexico.