Mexico's Lee Han-beom scanned the pitch for options before playing a 30-metre pass back to his goalkeeper, but it was a blunder by South Korea's Kim Seung-gyu that decided the game in a 1-0 win for Mexico.
The win marked Mexico's first entry into the knockout stage, and it was a much-needed triumph for the team and the country, which has been plagued by protests and issues with disappearances.
Head coach Javier Aguirre's team struggled to find openings against South Korea's sturdy backline, but Luis Romo was able to tap in a rebound in the 50th minute to seal the win.
The victory guarantees Mexico a Round of 32 match at Mexico City, where they will be widely backed to win their first knockout match at a World Cup in 40 years.