For the second consecutive Olympic Games, Canada has won bronze in women’s football.

The Canadian squad defeated Brazil 2-1 in the bronze medal match of the Rio 2016 women’s football tournament on Friday in Sao Paulo. The victory gives Canada its 20th medal of the Games.

PHOTOS: Canada, Brazil battle for bronze

Canada players celebrates after Christine Sinclair scoring their side's second goal during the bronze medal match of the women's Olympic football tournament between Brazil and Canada at the Arena Corinthians stadium in Sao Paulo, Friday Aug. 19, 2016. (AP Photo/Nelson Antoine)

Canada players celebrates after Christine Sinclair scoring their side’s second goal during the bronze medal match of the women’s Olympic football tournament between Brazil and Canada at the Arena Corinthians stadium in Sao Paulo, Friday Aug. 19, 2016. (AP Photo/Nelson Antoine)

At London 2012, Canada won its first ever medal in women’s football, defeating France 1-0 to claim bronze. Friday’s victory marks just the second time Canada has won back-to-back medals in a team summer sport, following lacrosse at St. Louis 1904 and London 1908.

Deanne Rose opened the scoring 25 minutes in thanks to a lovely cross from Ashley Lawrence. Then in the 52nd minute, captain Christine Sinclair, playing in her 250th game with Canada’s national team, scored to make it 2-0.

After the Brazilians started to gain some momentum following Sinclair’s goal, Rose nearly gave Canada a 3-0 advantage but hit the crossbar. Then in the 67th minute, Brazil’s goalkeeper allowed a rebound that Sophie Schmidt nearly put in.

RELATED: Canada to play Brazil for bronze

Canada's Deanne Rose, left, is congratulated after scoring her side's first goal by teammate Jessie Fleming during the bronze medal match of the women's Olympic football tournament between Brazil and Canada at the Arena Corinthians stadium in Sao Paulo, Friday Aug. 19, 2016. (AP Photo/Nelson Antoine)

Canada’s Deanne Rose, left, is congratulated after scoring her side’s first goal by teammate Jessie Fleming during the bronze medal match of the women’s Olympic football tournament between Brazil and Canada at the Arena Corinthians stadium in Sao Paulo, Friday Aug. 19, 2016. (AP Photo/Nelson Antoine)

Brazil got on the board in the 79th minute when Beatriz beat goalkeeper Stephanie Labbe. Brazil pressed in the final 10 minutes but could not net the equalizer.

Fittingly, Canada, ranked 10th in the world by FIFA, upset the eighth-ranked Brazilians to win bronze. At Rio 2016, Canada upset the fifth-ranked Australians to open group stage play and then defeated the second-ranked Germans. In the quarterfinals, Canada beat No. 3 France to advance to the semifinals where the team fell to Germany.