Saudi Arabia failed to make it to the World Cup round of 16 after losing 2-1 to Mexico, who also bowed out due to an inferior goal difference to Poland.
Henry Martin and Luis Chaves each scored in Mexico's furious attempt to stay alive at the World Cup, but the victory Wednesday night over Saudi Arabia was not enough.
Because of Argentina's 2-0 victory over Poland in a simultaneous match, Mexico failed to advance out of its group for the first time since 1978.
Mexico had reached the round of 16 at the last seven World Cups, which was tied with Brazil for the longest current streak.
El Tri went into the match at Lusail Stadium needing both a victory and help from Poland playing across town against Argentina to advance in Group C. Argentina's victory meant goal difference came into play.
Martin scored in the 48th minute to give El Tri hope, and the team's chances got even better with Luis Chavez's goal on a free kick four minutes later.
Mexico tried desperately in the final 20 minutes to get another goal — including an effort by Uriel Antuna in the 87th minute that was ruled offside — but came up short.