South Korea then stunned the world by defeating Germany 2-0 with two goals in the final minutes of the game.
With the clock ticking down at Yekaterinburg Arena and the scoreboard at 3-0, it appeared Mexico were about to be sent unceremoniously home from Russian Federation.
After silencing Osorio's critics with impressive wins over Germany and South Korea, Mexico almost blew it against Sweden and only progressed because of Germany's incredible defeat to South Korea.
According to Soccer Power Index, the chances of South Korea winning the match with Germany had been predicted to be around 5 percent.
Germany ended up last in Group F while Sweden and Mexico advanced to the round of 16.
"I went from crying to laughing", said Cecilia Gonzalez, a 22-year-old student who was celebrating the outcome of the roller-coaster ride with tequila.
It's extremely hard, at times impossible, for a coach to know the exact moment when it's right to leave.
But the best part is seeing the fans frolic in front of the South Korean embassy with tequila bottles for consul general Byoung-Jin Han in their hands. Many Mexicans also started listening to K-Pop, specifically BTS, in celebration.
Even fans of the Swedish team stopped off at the fiesta. "I wasn't happy with the way we defended but that's a learning curve for me". My expectations were so high. But we have not put in the performance we normally do.
"I thought we could use that as a reverse strategy and that has really hit the nail on the head".
Never before have they failed to qualify from the group stage.
"We are sorry for not playing like world champions and as painful as it is, we deserve to be out, " it tweeted.
"That is still valid, as far as we are concerned".
Germany's shock exit from the competition is good news for England, who now have an easier route through the competition.
"This is a country that grinds to a halt for football".