The Bruins, attempting to win their first Stanley Cup since 2011, couldn’t solve rookie goalie Craig Binnington early and couldn’t generate any chances late as the Blues pulled away for a 4-1 Game 7 victory on Wednesday night at TD Garden.

BOSTON -- Statistically, they’d done everything a team is supposed to do to take control of a series -- even win it.

 Their defensive game had been solid, their offense timely. The goaltending was consistently superior, special teams dominant.

 But the Bruins hadn’t been able to shake the Blues.

 Game 7 of the Stanley Cup Final was too much like that for the B’s.

 Despite a lopsided edge in play in Wednesday night’s first period, they couldn’t crack rookie goalie Jordan Binnington (32 saves), then made matters worse by surrendering two goals in the final 3:13. Unlike Game 1, there was no coming back from a 2-0 deficit, and the Bruins fell in their second attempt to win the Cup since 2011. The Blues, NHL members since 1967-68, took it back to St. Louis for the first time in franchise history via a 4-1 victory at TD Garden.

 The first Cup Final Game 7 the Bruins ever hosted turned within a span of 2:05 late in the first period. The Blues, who had generated only two shots before that, scored on two in a row, after the B’s had peppered Binnington with more than a dozen.

 Ryan O’Reilly got the Blues on the board at 16:17, getting his stick on a Jay Bouwmeester shot in the slot despite coverage by Bruins’ defenseman Brandon Carlo. Sammy Blais made two key plays in the sequence, first by taking B’s winger Noel Acciari down in a corner and taking the puck to the net for a shot that Tuukka Rask saved, then feeding it back to Alex Pietrangelo at the point while a screen formed in front of the Bruins’ net.

 A poor line change made the Blues’ second goal possible. Winger Brad Marchand, covering for defenseman Matt Grzelcyk, who had just joined an offensive rush (Grzelcyk played for the first time since sustaining a concussion in Game 2), held up Jaden Schwartz only briefly after Schwartz chipped the puck past him at the Bruins blue line, then left the ice as Pietrangleo jumped into the rush. Schwartz won a race with Charlie McAvoy for the puck and sent it back to the uncovered Pietrangelo, who quickly took the puck to his backhand and put a shot between Rask’s blocker and right leg.

 That goal, scored with eight seconds left in the period, was critical. It allowed the Blues to focus almost entirely on defense thereafter, and they did that to perfection.

 Binnington, under siege in the first period -- especially during a Bruins power play near the midway point -- faced only 11 shots in the second, most of them of low quality. He had to make a big save with 11:05 remaining in the third, stretching his right leg behind him to deny Joakim Nordstrom on a rebound chance that Nordstrom wasn’t able to lift, keeping it a 2-0 game. That save looked even more important less than three minutes later, when Brayden Schenn scored to push the Blues’ lead to 3-0 with only 8:35 remaining. Zach Sanford closed the Blues’ scoring with 4:38 remaining; Grzelcyk scored the Bruins’ only goal with 2:10 to go.

 The Blues, who had played in only one previous Cup Final (1970, when the three-year-old franchise was swept by the Bruins), completed a remarkable season. In last place in the NHL on Jan. 2, they went on to qualify for the playoffs and win the Cup largely on the strength of their road performance. Only 6-7 at Enterprise Arena, they went 10-3 at home, including three straight wins at TD Garden after losing Game 1. The Bruins were only 8-3 at the Garden.