BOSTON – A two-goal lead was down to one, and suddenly the Boston Bruins were trying to avoid another third-period collapse.

“At least we didn’t sit back; we didn’t panic; our guys responded well,” Bruins Coach Claude Julien said Thursday night after Boston snapped a two-game losing streak with a 4-2 victory over the Toronto Maple Leafs.

“When they made it 3-2 … we looked more like the team we were before than we did the last couple of games.”

Tyler Seguin had two goals and an assist and Patrice Bergeron had one of each as the Bruins recovered from back-to-back blown leads to hold onto the No. 2 point total in the Eastern Conference.

David Krejci also scored for Boston, Brad Marchand had a pair of assists and goalie Anton Khudobin stopped 25 shots.

“Today was a great third period,” said Khudobin, who was subbing for starter Tuukka Rask while the Bruins play 20 games in 36 days.

“We learned from (the previous) two games. Maybe we didn’t have good third period or second period, but we’ll learn. Today was a great third period. Guys played awesome.”

With the win, the Bruins moved three points ahead of Toronto in the Northeast Division while remaining one point behind first-place Montreal.

Nazem Kadri and Jay McClement scored for the Leafs, and goalie Ben Scrivens made 21 saves for Toronto, which had won three in a row.

“It’s about good habits,” said Clarke MacArthur, who assisted on Kadri’s sixth goal in four games. “We can take a lot of good things out of the game. Obviously those two points would have been huge for us, but we have to take the good positive things we did and take that into Pittsburgh.”

The Leafs, who had won three in a row, pulled their goalie in the final minutes, but they struggled to set up in the offensive zone and Seguin had an empty-netter with 15 seconds left.

Boston made it 1-0 with 53 seconds left in the first period when Marchand fought the puck out from the boards near the blue line and Seguin came by and picked it up. He went straight to the goal, and Bergeron knocked in the rebound.

Kadri and MacArthur converted on a 2-on-1 against Dennis Seidenberg to tie it early in the second period.

Boston took the lead again when three guys committed to Marchand along the boards and the puck came out to the middle, where Seguin scored on a wrist shot and then had to jump over MacArthur as he dove to try to block the shot.

Krejci made it 3-1 late in the second. That’s how it stayed until Mikhail Grabovski skated out from behind the net and took a shot that was deflected in by McClement to make it 3-2.

NOTES: The Bruins waived Chris Bourque, the son of Hall of Famer Ray Bourque who had just one goal and three assists in 18 games. … Hall of Famer Milt Schmidt dropped a ceremonial first puck in honor of his 95th birthday.