The Red Sox bullpen was trying its damnedest to make sure Boston lost Wednesday night at Rogers Centre, but the offense had other ideas.

Despite one meltdown after another by the relievers, the Red Sox emerged with a 6-5 victory over the Toronto Blue Jays thanks to a Michael Chavis solo shot in the 13th inning.

Rick Porcello delivered a sharp outing, while Rafael Devers smashed his third homer in as many games, but Marcus Walden blew the save in ninth inning to force extras. However, the missteps of Walden and the rest of the bullpen allowed Chavis to play hero.

The Red Sox climb to 26-23 with the win, while the Blue Jays fall to 20-29 with the loss.

Here’s how it went down:

GAME IN A WORD
Level.

After a pair of blowouts to begin the series, Wednesday’s tilt was a little more even.

ON THE BUMP
— Porcello was dialed in, allowing one run on three hits over six innings, striking out four while not issuing a walk.

The first three innings were smooth for Porcello, who pitched a pair of 1-2-3 stanzas and allowed just a single in the other. The right-hander gave up his only run in the fourth, thanks, of course, to Vladimir Guerrero Jr.

Porcello left a 2-1 curveball over the heart of the plate to the Guerrero, and the rookie clubbed a homer to straightaway center, cutting Boston’s lead to 2-1.

Porcello responded by retiring the side in order in the fifth and allowing a single in a scoreless sixth to end his night.

— Brandon Workman took over in the seventh and wandered into some trouble.

The right-hander loaded the bases on two hits and a walk, then walked in a run, which cut the Sox’s lead to 3-2. Workman kept the lead intact though, getting Eric Sogard to ground out to second to end the inning.

— Matt Barnes handled the eighth, and after a good start he too allowed a run.

With one down, Barnes hung a curveball on the inner half and Justin Smoak cleared the fence in right, trimming Boston’s advantage to 4-3.

Barnes buckled down and got Randal Grichuk to ground out to short to end the inning.

— Walden got the ninth and blew the save, then gave up the game-winner in the 10th.

He allowed a one-out double to Brandon Drury, who ended up reaching third before coming home on a pinch-hit single by Danny Jansen, tying the game.

Sox manager Alex Cora trotted Walden back out for the 10th, and though he loaded the bases with one out, he got out of the frame unscathed.

— Ryan Brasier pitched a 1-2-3 11th inning.

— Heath Hembree got through the first two hitters without issue, then let Rowdy Tellez golf a game-tying homer into center, forcing a 13th inning.

Hembree returned for the 13th and was tasked with protecting another lead, and the second time around he came through, tossing a 1-2-3 ninth.

IN THE BATTER’S BOX
— The Red Sox scored the game’s first runs, scoring a pair in the third inning.

Jackie Bradley Jr. was hit by a pitch to begin the frame, moving to second the next at-bat on a Sandy Leon groundout. Mookie Betts walked with two outs, then a Mitch Moreland single to right plated Bradley from second. After Betts stole third, Xander Bogaerts singled to right to drive him in, making it 2-0.

— With their lead cut to 2-1, the Red Sox added another run in the seventh.

Bradley kicked off the inning with a double, and a pair of one-out walks loaded the bases. But the Sox only could manage just one run, with Bradley coming home on a Moreland groundout to second.

— Ahead just 3-2 in the eighth, Rafael Devers added some much-needed insurance.

The third baseman led off the inning, and with the count at 1-1, he took a Derek Law fastball the other way and over the fence to swell Boston’s lead to 4-2.

— With the game locked up at four runs apiece in the 12th inning, Betts came up big.

Facing Joe Biagini, a pitcher he’s owned, Betts smacked a solo home run to dead center to put the visitors ahead.

— With the game tied at five and one out in the 13th, Chavis put the Sox ahead once more, sending a 1-2 cutter into orbit.

— Bogaerts had a three-hit night.

— Betts, Andrew Benintendi, Moreland, Devers, Chavis, Christian Vazquez and Bradley had one hit apiece.

— Sandy Leon went hitless.

TWEET OF THE DAY
Good company.

UP NEXT
The Red Sox and Blue Jays will play the finale of the four-game set Thursday afternoon. Ryan Weber will get the ball for Boston, while Toronto’s starter is to be determined. First pitch from Rogers Centre is set for 12:37 p.m. ET.

Thumbnail photo via Nick Turchiaro/USA TODAY Sports Images