Updated

There may be a medal in Mexico's future for men's soccer.

Giovani Dos Santos and Hector Herrera scored in extra time as Mexico beat an error-prone Senegal 4-2 Saturday to reach the semifinals of the Olympic football tournament.

Senegal erased Mexico’s 2-0 lead with second-half goals from Moussa Konate and substitute Ibrahima Balde, but then turned the ball over twice in extra time to hand Mexico the win in front of 81,855 spectators at Wembley Stadium.

Dos Santos’ free kick set up Jorge Enriquez’s 10th-minute goal before another defensive blunder by Senegal led to Javier Aquino making it 2-0 in the 62nd.

Konate’s tournament-high fifth goal started the rally, but Senegal’s impressive rally was ultimately undone by awful defending.

Mexico will at least match its previous best Olympic finish of fourth at its home games in 1968, will play Japan here on Tuesday. Japan beat Egypt 3-0 at Old Trafford earlier Saturday

Eight minutes into extra time, Senegal defender Papa Gueye was dispossessed after a lazy backpass, with Dos Santos pouncing on the loose ball to curl in his third goal past goalkeeper Ousmane Mane.

Senegal captain Abdoulaye Ba then tried to head the ball back to Mane, only for substitute Raul Jimenez to run onto the ball and force the ‘eeper into a save, with Herrera heading the rebound into the empty goal.

Herrera, a second-half substitute, had been booked moments earlier and will miss the semifinal because of a suspension.

Mexico had started stronger as Enriquez guided a hard free kick by Dos Santos beyond Mane. El Tri then sat back and Senegal would have equalized if not for Corona, who dove to swat away Konate’s goal-bound header in the 25th.

Corona made another point-blank save, this time on Papa Souare, just five minutes before Dos Santos sent a low ball into the middle of the area, which Mane eventually spilled into the path of Aquino, who blasted it into the roof of goal.

But Konate continued his impressive London Games with another key goal, as the 19-year-old Maccabi Tel-Aviv striker rose unmarked at the far post to guide Souare’s high cross under Corona.

Balde, who came on moments before Mexico’s second goal, ran into the area to power Souare’s cross home for the equalizer.

Mexico nearly won it in stoppage time but Peralta headed Dos Santos’ cross just over the crossbar.

Gold-medal favorite Brazil played Honduras and Britain played South Korea in the other quarterfinals.

Based on reporting by the Associated Press.

Follow us on twitter.com/foxnewslatino
Like us at facebook.com/foxnewslatino