Cape Town - Croatia needed to win to ensure they made the knock-out stages, and though they made much of the running for large parts of the game, they failed to capitalise on their chances, allowing a Mexico side content for the most part to play defensively to come alive late in the second half and put the result beyond question.
As it happened: Croatia v Mexico
Croatia had the better of the early exchanges, with Ivan Rakitic teeing up his namesake Ivan Perisic for an attempt at goal, but the midfielder shot over.
Both teams were playing cagey football at first, to feel the other out.
It soon became end to end stuff, however, as Rafael Marquez cleared a Perisic cross out for a corner, only for the ensuing delivery to be headed clear before it could reach Mario Mandzukic's head for the nod.
Mexico seized the opportunity to break and the first real chance for them fell to Hector Herrera, who let fly from 25 yards as his strike crashed back off the crossbar.
With Croatia knowing they needed to win, they were showing most of the attacking intent, even though they were doing precious little to trouble Guillermo Ochoa in goal.
Another rare chance fell to Perisic, but his slashed shot from outside the area only found the stands, as the Mexicans remained well organised at the back and more than happy to eke out the draw.
Luka Modric and Rakitic, meanwhile, were not creating the kinds of opportunities in midfield their fans would have been hoping for.
With the game still scoreless at half-time, Croatia tried to show more urgency at the start of the second period, but though they had plenty of possession, chances remained few and far between.
Inter Milan playmer Mateo Kovacic replaced defender Sime Vrsaljko, but even this attacking boost could not force a goal.
Just after the hour-mark, Mexico should have had a penalty after Croatia skipper Darijo Srna clearly handled the ball in goal.
Referee Ravshan Irmatov waved play on, however, but this only seemed to galvanise the Mexicans, as old-timer Marquez finally broke the deadlock in the 72nd minute, beating Vedran Corluka to the header to put his side ahead - though poor hands from Croatia keeper Stipe Pletikosa were certainly also to blame.
Three minutes later, Mexico doubled their advantage, with midfielder Andres Guardado firing home amid sensational celebrations from the players, the coach and the fans.
With the Croations' World Cup dreams utterly shattered, a third goal soon followed. Rafael Marquez flicked on a corner at the near post and Javier Hernandez swooped in to send the ball over the line.
There was a consolation goal to come for Croatia three minutes from time, as a Rakitic pass finally found the perfect target in Perisic, who shot past Ochoa for their first and only goal of the evening.
Croatia's final play of the 2014 World Cup was not one to remember - an 89th-minute red card for substitute Ante Rebic, whose frustrations boiled over as he left a boot in high and dangerous on Carlos Pena.