Second half goals from Shelina Zadorsky and Janine Beckie helped Canada to its first-ever Algarve Cup title with a 2-1 win over Brazil in Portugal on Wednesday.

Canada’s previous best result at the annual invitational women’s football tournament was fourth place in 2001.

Wednesday’s win can be technically called an upset as Brazil is ranked seventh in FIFA’s women’s rankings, while Canada is rated at 11th best.

Janine Beckie tries to evade a sliding tackle against Guatemala in CONCACAF Olympic qualifying on February 16, 2016.

Janine Beckie tries to evade a sliding tackle against Guatemala in CONCACAF Olympic qualifying on February 16, 2016.

Zadorsky scored at the hour mark, converting a corner from Ashley Lawrence. A few minutes later Beckie got the insurance marker for Canada that proved all-important.

The tournament didn’t start so smoothly for Canada, losing to 15th ranked Denmark 1-0 in its opener during the round robin portion. Since then Canada didn’t concede a single goal until the 89th minute of the final, beating Belguim 1-0 on the strength of a late Summer Clarke goal and Iceland by the same margin behind a first half strike from Beckie.

RELATED: Canada qualifies for Rio 2016
RELATED: Christine Sinclair looks ahead

Those two wins gave Canada the top spot in Group A and secured a place in the final as per the Algarve Cup format. Brazil made the final by winning Group B ahead of New Zealand, Russia and host Portugal.

Canadian defender Kadeisha Buchanan was named player of the tournament.

Paths may cross again for Canada and Brazil at Rio 2016, where both countries will take part in the women’s Olympic football tournament, along with New Zealand as the other Algarve Cup nation heading to South America for the 12-team competition.