BOSTON — Tuukka Rask has been quite open about his disdain for the shootout. But Saturday night, with a very big point on the line, the Boston Bruins goaltender was perfect in the skill competition and gave his team a win.

“When Tuukks is our best player, then you know we have a good chance at winning a hockey game,” defenseman Torey Krug said after Rask stopped 27 shots in the game and all three attempts in the shootout as the Bruins pulled out an important 2-1 victory over the pesky Toronto Maple Leafs. “He’s seeing the puck right now and it’s good.”

The win was the Bruins’ fifth straight — Rask allowing eight goals in the five games — and allowed Boston to keep pace in the wild Eastern Conference playoff race.

Rask pumped his glove when he stopped center Nazem Kadri to end the game, the win improving the Bruins to just 4-9 in shootouts, 13-13 in extra time.

Toronto goaltender James Reimer, who stopped 49 of 50 shots in 65 minutes, was beaten by center Patrice Bergeron in the second round of the shootout. That was the only goal.

The Bruins (41-25-13) remained tied with the Detroit Red Wings, who won Saturday, for third place in the Atlantic Division. Detroit has a game in hand. Boston also moved into a tie with the Pittsburgh Penguins for the top wild-card spot; the Penguins also with an extra game to play.

Boston also remained three points ahead of the Ottawa Senators.

Bergeron scored Boston’s goal in regulation, coming through 19 seconds into the second period. But Toronto left winger John van Riemsdyk got that back later in the period.

The 47 shots the Bruins had on Reimer in regulation were the most by Boston since April 2, 2013, when the Bruins had 50 against Ottawa.

The Leafs (29-43-7) are 2-1-1 in their last four games after losing seven straight.

The Bruins failed to score on 19 shots at Reimer in the first period, but Bergeron struck quickly in the second, his first goal in six games and 22nd of the season. That was all they would get on Reimer.

“He was awesome,” said van Riemsdyk, who, when asked about playing the Bruins, said, ever since I’ve been here, Boston’s always a game you really get up for. You know it’s going to be a big challenge with a lot of the guys they have over there, so it’s always a fun game to play in.”

“Give their goaltender credit, he was outstanding tonight, gave them a chance to stay in it,” said Bruins coach Claude Julien. “From our end of it, you tell yourself you’ve got to find ways to score goals. It was tough.

“There’s no doubt the team was getting tight there at the end because of that. You’re always fearing the worst when a team is hanging around that long. Thankfully we were able to get a break there in the shootout and finally win one.”

Bergeron scored on his own rebound and the Leafs got that back on a strange bounce. Center Tyler Bozak won a faceoff in the Boston zone and the puck wound up with defenseman Morgan Rielly at the point. His shot went off Rask, hit van Riemsdyk, bounced off Rask’s head and then went in when Bruins defenseman Adam McQuaid bounced the puck off his goalie while trying to clear it.

It was the team-high 26th goal of the season for van Riemsdyk.

The assist by Marchand was only his second point in 14 games, his first at home. He had a rebound chance in the third period but hit the post.

Toronto center Trevor Smith left the game early after absorbing a heavy hit from Bruins defenseman Zdeno Chara and suffering an apparent head injury.

There was no penalty on the play.