The Toronto Maple had been here before — up a goal heading into the third period of an elimination game at TD Garden.

Wednesday's collapse won't rewrite any record books, but it hurts just the same.

Jake DeBrusk scored his second of the night on a great individual effort as the Boston Bruins stormed back over the final 20 minutes to stun the Leafs 7-4 in Game 7 of their series and advance to the second round of the Stanley Cup playoffs.

Toronto led 4-3 through two periods, having clawed its way back from a 3-2 deficit.

Then the wheels fell off.

"You're all part of it when it goes good, you're all part of it when it doesn't," Leafs head coach Mike Babcock said. "We came into the third period in a great spot.

"For them, for us. It was all right there. There was one period to go."

There was also one period to go five years ago in Boston when Toronto led 2-1 through 40 minutes of Game 7 and 4-1 midway through the third period only to make NHL history as the first team to blow a three-goal cushion in that situation before losing in overtime.

Boston scored four goals in the third period of a 7-4 win over Toronto. 2:05

'Not the way we saw it going'

The cast of characters is largely different, and the Leafs didn't give up a late three-goal lead on this night, but they did surrender advantages of 1-0, 2-1 and 4-3, refusing to punch back when the Bruins came hard in the third.

"Not the way we saw it going," said teary-eyed Toronto defenceman Jake Gardiner, who was on the ice for five goals against. "Personally I've got to be better. A lot of this game is on me. And it's just not good enough, especially in a game like this. It's the most important game of the season, and I didn't show up. There's not much I can say, really."

"It's going to be a tough one to swallow," Gardiner added later. "I let a lot of people down."

Boston, which led the series 3-1 before Toronto mounted a comeback to push it to Game 7, will take on the Tampa Bay Lightning in the Eastern Conference semifinal.

Game 1 of that series goes Saturday in Tampa, Fla.

Just like in 2013, Boston scored 4 unanswered goals to advance to the 2nd round and send the Toronto Maple Leafs packing​ 0:57

Patrice Bergeron, with a goal and two assists, David Pastrnak, Danton Heinen, Torey Krug and Brad Marchand, into an empty net, also scored for the Bruins. David Krejci had three assists, while Kevan Miller added two of his own.

"Didn't matter how long it was going to take," Krug said. "We were going to do the job."

Tuukka Rask made 20 stops. Pastrnak and Marchand had an assist each for two-point nights.

Patrick Marleau, with two, Travis Dermott and Kasperi Kapanen replied for the Leafs, who got 29 saves from Frederik Andersen. William Nylander added two assists.

Empty feeling

Toronto forced Game 7 with a 4-3 victory in Game 5 where Andersen stood on his head with a 42-save performance in Boston before picking up 3-1 win on home ice in Game 6.

The netminder was brilliant in those outings, but wasn't at his best Wednesday.

"Being able to force Game 7 is great," Andersen said. "Obviously a pretty empty feeling right now."

Boston tied it 70 seconds into the third when Krug blasted a shot from the point through a screen with the teams playing 4 on 4.

Boston Bruins left wing Jake DeBrusk is embraced by David Krejci (46) after his goal against Toronto Maple Leafs goaltender Frederik Andersen (31) during the third period of Game 7. (Charles Krupa/The Associated Press)

The Bruins then pulled in front at 5:25 with both clubs again playing down a man when he cut around Gardiner off the rush and slipped a shot through Andersen's five-hole at an electric TD Garden.

"He got it off quick, he made a good move," Andersen said. "He surprised me a little bit."

Pastrnak then put it away with 8:21 to play, and Marchand scored into an empty net in the final minute.

Down 3-2 following a wild first period where they led twice, the Leafs tied things at 2:07 of the second when Dermott ripped a shot past Rask for the rookie's first playoff goal.

The Bruins then went on the power play, with Andersen robbing Krug on a spectacular save from the slot to set up Kapanen shorthanded. The rookie winger fought off Marchand before moving in alone on Rask and beating the Bruins netminder with a slick move at 6:05.

'We were fresh'

"Disappointed," Babcock said. "We were set up perfect going into the third.

"We were fresh. I thought we were the fresher team, and we were in the driver's seat."

Toronto exits the first round for the second straight spring, but despite the spirited comeback, this stings after a season where the club set franchise records for points (105) and wins (49).

While last year's Leafs were just happy to make the playoffs, the 2017-18 edition expected to make some noise.

But the loss of centre Nazem Kadri to a three-game suspension in the opener against Boston, Andersen's suspect play for long stretches, and the inability of Nylander and Auston Matthews to ever really get going cost Toronto.

Boston Bruins' Torey Krug, David Backes and Brad Marchand celebrate a first-period goal against the Toronto Maple Leafs in Game 7. (Maddie Meyer/Getty Images)

While Matthews garnered more attention from the Bruins than any other Leafs forward, the 20-year-old star didn't leave a mark on the series.

A bright spot up front for the Leafs was the play of winger Mitch Marner, who led his team with two goals and seven assists.

"It's definitely frustrating," said Matthews, who could only muster a goal and an assist in seven games. "We wanted to keep it going. We had the opportunity tonight.

"We let it slip."

Marleau scores pair

Marleau opened the scoring on the power play at 2:05 of the first when he tipped Gardiner's point shot, but DeBrusk tied it on a Boston man advantage just 2:42 later, moments after Andersen reached back to stop a puck dribbling towards to goal line with the help of teammate Tomas Plekanec.

Marleau restored Toronto's lead at 6:12 off a great pass from Marner, but the Bruins came back once again when Heinen beat Andersen at 9:10 to cap stretch of four goals on 11 combined shots.

The Leafs lost Morgan Rielly later in the period after he took a Zdeno Chara shot from the point in the mouth while battling in front. The bleeding Toronto defenceman missed the rest of the period, but returned for the second.

Marner and Matthews had a couple of chances to restore the Leafs' lead in that frenetic opening 20 minutes, but the Bruins went ahead with 36.4 seconds left when Miller shot intentionally wide right to Bergeron, who buried his first point since Game 2.

"We just could not hold the leads," Leafs defenceman Ron Hainsey said. "We had three of them and couldn't hold the lead."