The defending champions easily won Group A despite a depleted squad after five players were suspended last week for testing positive for the banned substance clenbuterol.
Mexico's 14 goals are the most of any team in the tournament. El Tri has also conceded just one, a 69th-minute strike by Marco Urena of Costa Rica.
Mexico now faces the third-place team from Group B or Group C in Saturday's quarterfinal match.
Costa Rica also advanced after finishing second in the group, ahead of El Salvador on goal differential.
"It was easy for Mexico," Costa Rica coach Ricardo Lavolpe said through an interpreter. "Too simple."
Mexican goalkeeper Guillermo Ochoa and defender Francisco Rodriguez— both starters on last year's World Cup team — and three others were dropped from the squad last Thursday after the positive drug tests.
The Mexican federation has blamed the results on contaminated meat and asked to replace the players, but CONCACAF officials are seeking more information before making a decision.
But coach Manuel de la Torre said El Tri's goal remains the same, regardless of how many players are on the roster.
"The main objective is to win the Gold Cup," he said. "This group very much knows what it needs to do to represent Mexico. Whatever situation is presented, the team knows the only way to get where we need to go is on the field."
Costa Rica, which has made the quarterfinals in the last five Gold Cups, was expected to be Mexico's toughest opponent in the group stage. The Ticos are coached by Ricardo La Volpe, who led Mexico to the second round of the 2006 World Cup.
But Mexico overwhelmed Costa Rica with its fast-paced, energetic style, much to the delight of the sellout crowd of 62,000 at Chicago's Soldier Field — overwhelmingly supporting Mexico. Any hope Costa Rica had of an upset win was gone by the 20th minute, with Rafael Marquez (17th) and Guardado (19th) giving Mexico a quick 2-0 advantage.
"It was like a splash of cold water," Lavolpe said. "We couldn't react."
Guardado scored again in the 26th minute with a strike from the edge of the box. Pablo Barrera made it 4-0 with a shot in the 38th.
The margin could have even been greater, but Manchester United's Javier Hernandez missed a shot from close range and Costa Rica goalkeeper Keylor Navas tipped a second-half shot by Salcido over the crossbar.
"It's true we played a good match," de la Torre said. "But there is always room for improvement."
Copyright 2011 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.