Mexico, which lost to Brazil in a penalty-kick shootout in the semfinal stage, beat Japan 3-1 to claim the bronze medal.

The usual European and South American heavyweights — Spain, France, Germany, Brazil and Argentina — were the pre-tournament favorites going in, but it was Spain and Brazil which advanced all the way to the final after Germany, France and Argentina were eliminated in the group stage.

The Men’s Football Tournament kicked off with a round-robin group stage in which each team played three matches against the others in the group (July 22, July 25 and July 28). Teams collected three points for a win, one for a draw and none for a loss. The top two finishers in each group advanced to the quarterfinals, with the pairings predetermined based on group finish.

MORE: Men’s Olympic soccer top scorers

Olympic group tiebreakers

If teams were even on points, tiebreakers were used one by one until all ties were broken. Here’s the order of tiebreakers as detailed in the official tournament rules :

Superior goal difference in all group matches Most goals scored in all group matches Most points obtained in group matches between the teams that are tied Superior goal difference in the group matches between the teams that are tied Most goals scored in the group matches between the teams that are tied Best conduct score based on fewest yellow/red cards in all group matches Drawing of lots by FIFA if there are still teams that remain tied

The final group standings, results and knockout round schedule follow below:

Group A standings

X = advances to quarterfinals

Group A schedule

Group B standings

X = advances to quarterfinals

Group B schedule

Group C standings

X = advances to quarterfinals

Group C schedule

Group D standings

X = advances to quarterfinals

Group D schedule

Quarterfinals

Semifinals

Bronze-medal match

Gold-medal match