BOSTON -- David Pastrnak scored at 1:54 of overtime, and the Boston Bruins eliminated the Toronto Maple Leafs with a 2-1 win in Game 7 of the Eastern Conference First Round at TD Garden on Saturday.

Pastrnak skated into an intentional dump-in by Hampus Lindholm, cut across the crease, and scored with a backhand over the right pad of Ilya Samsonov.

“Huge moment, obviously,” Pastrnak said. “A lot of excitement. You could say a little relief as well. It was a tight-checking game, so it was nice to get it. And obviously the happiness from the group and sticking together the whole series was unbelievable, and couldn’t be more proud of ourselves.”

Lindholm scored the game-tying goal in the third period, and Jeremy Swayman made 30 saves for Boston, which is the No. 2 seed from the Atlantic Division.

The Bruins will play the Florida Panthers, who eliminated the Tampa Bay Lightning in five games, in the second round.

“When you’re not getting a lot of offensive chances, you lose your patience at times, and we talked about not losing our patience," Bruins coach Jim Montgomery said. “Being above, being behind, being physical and just being relentless with that kind of attitude, that’s why I was really happy to see the maturity of our group.”

William Nylander scored for Toronto, which was the No. 3 seed from the Atlantic. Auston Matthews had an assist in his return after missing Games 5 and 6 because of an illness and undisclosed injury.

“Obviously, this series [was] very close,” Maple Leafs coach Sheldon Keefe said. “That is the thinnest of margins you can get in Game 7 overtime. So, obviously very disappointing to not come on the right side of it. Loved how our team fought to put us in this position and compete and play in this game and have a chance to be one shot away.”

TOR@BOS R1, Gm7: Nylander, Matthews combine for opening goal

Samsonov made 29 saves in place of Joseph Woll, who had started and won the previous two games but was a late scratch because of an undisclosed injury.

“We were right there,” Maple Leafs captain John Tavares said. “I mean, it's a very small difference. And just the type of hockey that we played, the way we needed to play to give ourselves a chance to win the series ... there's no doubt that we were right there."

Nylander gave the Maple Leafs a 1-0 lead at 9:01 of the third period. Tyler Bertuzzi forced defenseman Brandon Carlo into a turnover deep in the Bruins' zone, and Matthews found Nylander for a one-timer from the left hash marks.

“Really proud of the way the guys battled back and hung in there being down 3-1 (in the series),” Matthews said. “I don't think there was any doubt that we could get to this point and climb our way back in the series. And it was really hard to watch those two games, but just really proud of the guys to fight and battle back and give ourselves a chance.”

TOR@BOS R1, Gm7: Lindholm responds with goal to even game in 3rd

Lindholm responded at 10:22 to tie it 1-1. He scored short side with a shot off the right arm of Samsonov from the left face-off dot.

“Just try to get pucks to net,” Lindholm said. “I think I’ve been a little holding onto pucks, try to make it a little too hard on myself, so just try to find that little opening and just get it there, and then good things usually happen.”

Nylander nearly won it with two seconds remaining in regulation after his centering pass deflected off the skate of Bruins defenseman Parker Wotherspoon, but Swayman kicked out his left pad to make the save and force overtime.

“Just a pinch yourself moment that you’re in Game 7 overtime at home,” Swayman said. “It’s stuff that you dream of as a kid and that we could all get up for and be really excited about, but my mindset was just one shot at a time. Doing my job and enjoying the process.”

NOTES: Boston has won seven straight playoff series against Toronto. Each of the past four have gone to Game 7. ... The Bruins played the Panthers in first round last season. Florida won that series in seven games after Boston blew a 3-1 lead.