Deanne Rose opened the scoring after a quick break in the first half, and set up Christine Sinclair to add to her international legacy.
Beatriz set up a grandstand finish, but Brazil couldn't find a second to force extra-time.
Rose rams home the opener
The game started with both sides going head-to-head in the hustle and bustle of a midfield battle. The pair were throwing everything into going forward, though Canada were more organised than the hosts. Sinclair came closest to an early opener, as her free-kick whipped up and over the wall only to crash off the bar and away to safety.
Brazil's best chance fell to Andressa Alves after a corner dropped kindly to the attacker in the area, although she couldn't squirm the ball through the swarm of players in front of her. Canada were proving more dangerous despite having less of the ball, as Brazil seemed set in their ways; if it wasn't done individually, it was a poor cross into the box.
Herdman's charges were then rewarded for their attacking prowess. Rafaella lost the ball in the opposing half and a quick Canadian break saw Ashley Lawrence rocket past Fabiana, bursting into the Brazil box. She had the awareness to look up and pick out the arriving Rose, who gleefully tapped in at the back post.
Brazil's late show not enough
Debinha came on for Cristiane at the break, but just six minutes later the game was all over. Jessie Fleming did superbly to wriggle away from her marker and feed in Rose, who drove to the by-line as a result. Her ball back into the middle was perfect for Sinclair, who was able to control and pass into the near post to make it two-nil.
Aside from a good Rafaelle chance, which she put just wide, the remaining exchanges were all in Canada's favour as the weight of Brazil's expectation weighed down heavily on their players' shoulders. It was proving to be an almost immovable mental block that was preventing the team from running riot as they did during the groups.
The first let off came when Monica was caught out by a long ball forward, and the energetic Rose rattled the post from close range after losing her footing. Brazil then had Poliana to thank for a remarkable goal-saving tackle after Lawrence had a shot saved by Barbara; the substitute just managed to clear before Sophie Schmidt pounced.
Then, out of nowhere, Brazil responded. Debinha missed a glorious opportunity from Marta's run and cross, somehow skewing her header wide from close range. The hosts continued pushing and a long Rafaelle throw-in was flicked on by Erika. That was gathered by Beatriz and a wonderful turn and finish later, and Brazil had hope.
Marta and Formiga both came close to finding dramatic late equalisers, though they just couldn't quite apply the finish needed. Canada claimed bronze for the second Olympic Games running and, overall, it was deserved. Brazil perhaps, as some have said, needed victory but fell agonisingly short.