BOSTON — The Boston Bruins couldn’t have drawn it up any better.

Prior to Saturday’s game against the Los Angeles Kings, star center Patrice Bergeron was honored for playing his 1000th game Tuesday night against the New York Islanders. And after a thrilling, back-and-forth affair, Bergeron scored an overtime game-winner to give the Bruins a 5-4 win over the Kings at TD Garden.

Bruins head coach Bruce Cassidy shuffled his lineup with secondary scoring tough to come by. Cassidy slid David Pastrnak down to the second line and replaced him with Danton Heinen, who’s played well as of late but has struggled to find his scoring touch for much of the season. Jake DeBrusk took Heinen’s spot on the third line.

The shakeup clearly worked, as Heinen responded with a goal and an assist, and the second unit chipped in as well.

The Bruins improved to 30-17-8 with the win, while the Kings fell to 23-28-4 with the loss.

Here’s how it all went down:

The first period was a prime example of the difference an all-world goalie can make.

The Bruins outshot the Kings 15-6, but Kings netminder Jonathan Quick stood on his head, stopping every shot while making multiple highlight-reel saves. Both teams got chances on the power play, with Boston going 0-2 and Los Angeles coming up empty on its only try.

The highlight of the first period might’ve been this tribute video for Bergeron:

Greatness respects greatness.

As good as the Bruins were in the first period, the Kings were even better in the second.

However, it was the Bruins who broke the scoreless tie, as Charlie McAvoy scored off a great pass from Bergeron at 4:38 to give Boston the lead. It was McAvoy’s second goal of the season and first in over four months, with his last tally coming Oct. 13 against the Detroit Red Wings.

Let’s take one more look at that pass from Bergeron:

The Kings largely dominated play from that point on.

The Bruins committed three penalties in the period, all of which resulting from heavy pressure by the Kings. David Krejci went off for slashing at 7:36, and Alex Iafallo responded less than a minute later by tying the score at one.

Anze Kopitar put Los Angeles in front nearly six minutes later.

Boston started to regain momentum toward the end of the period, but Brandon Carlo’s tripping penalty at 16:38 helped tilt the ice back in the Kings’ favor.

Los Angeles outshot Boston 16-7 for the period.

Whatever Bruins head coach Bruce Cassidy said in the locker room, it clearly worked.

Boston took the ice with renewed energy in the third, and was rewarded at 3:27 with Heinen’s eighth goal of the season. Cassidy’s lineup shuffle gave Heinen an opportunity to play with Bergeron and Brad Marchand, and the second-year forward delivered.

(You can click here to watch video of the goal.)

Less than two minutes later, with “Beat L.A.” chants raining down from the Garden rafters, Krejci buried a rebound attempt to give the Bruins a one-goal lead. It was the veteran center’s 12th goal of the season.

(You can click here to watch video of the goal.)

But wait, there’s more.

Chris Wagner got called for a trip at 5:15 to put the Bruins on the penalty kill. But it mattered not, as a Kings turnover led to a 2-1 breakaway for Marchand and Bergeron, and Marchand converted the gimme.

Despite having all the momentum, the Bruins fell back on their heels midway through the period, and Kings center Nate Thompson made them pay with his fourth goal of the season.

Defenseman Oscar Fantenberg tied the game nearly six minutes later with his first goal of the season.

The Bruins outshot the Kings 7-6 for the period.

The Kings had a chance to win the game seconds into overtime, but Tuukka Rask denied Adrian Kempe’s breakaway attempt, drawing massive cheers from the Garden crowd. Ilya Kovalchuk was called for tripping moments later, giving Boston a 4-on-3 advantage.

Bergeron, fittingly, buried the game-winner a minute into the power play. It was his 20th goal of the season.

The Bruins will return to the ice Sunday afternoon when they host the Colorado Avalanche in the second half of a back-to-back. Puck drop at TD Garden is scheduled for 3 p.m. ET

This Bruins Wrap is presented by Plainridge Park Casino.

Thumbnail photo via Brian Fluharty/USA TODAY Sports Images