By Michael Hurley, CBS Boston

BOSTON (CBS) — A game between the best and one of the worst teams in baseball is not supposed to be so dramatic. Nevertheless, Tuesday night’s game between the Boston Red Sox and Miami Marlins was anything but short on drama.

READ MORE: Watch Live @ 8:30 am: Baker Visits Newburyport School's Pool COVID-19 Testing Program

Most of that action began after the seventh-inning stretch. The Red Sox had built a 4-1 lead over Miami heading into the eighth inning, providing a deep enough cushion to cement an easy victory. Or so they thought.

But in a season where the Red Sox bullpen has struggled to get through the eighth inning, Matt Barnes took the problem to new heights (or depths, one supposes). The right-hander allowed a leadoff single to Brian Anderson before giving up an absolute bomb from J.T. Realmuto over the Monster.

The Red Sox, though, still had a lead. Briefly.

Starlin Castro stepped to the plate with the bases empty and his Marlins trailing 4-3. That’s when he got all of a 1-1 fastball over the heart of the plate, sending it into the bullpen and tying the game.

Barnes later allowed a one-out single from Austin Dean, which prompted manager Alex Cora to bring in Heath Hembree. Things didn’t get any better.

Hembree allowed a single to the first batter he faced, Miguel Rojas. After retiring Isaac Galloway, Hembree walked JT Riddle on five pitches to load the bases. With the score tied, Hembree induced some weak contact from Rafael Ortega, but the flare fell in shallow left field, bringing home two runs and giving the Marlins a 6-4 lead.

The 2018 Red Sox being the 2018 Red Sox, though, the game was far from lost. That also had to do with the 2018 Marlins being the 2018 Marlins, of course.

J.D. Martinez singled off Tayron Guerrero to lead off the bottom of the eighth. Two batters later, Eduardo Nunez sent a one-out single into right-center field, followed by another single by Ian Kinsler. With the bases chucked and one out, Blake Swihart struck out, bringing up Jackie Bradley Jr. The Sox’ center fielder sent a 3-2 offering back up the middle, through the shift, plating two runs to tie the game.

Mookie Betts stepped up with a chance to reclaim the lead for the Red Sox. He didn’t have to do much to accomplish the task, as Guerrero’s 3-1 pitch sailed up and over Betts’ head, allowing Kinsler to cross the plate.

With the 7-6 lead safely intact, all Boston needed was for Craig Kimbrel to come on and put this game out of its misery. But it wasn’t quite that simple.

READ MORE: 582 At Massachusetts Schools Test Positive For COVID-19 In Last 2 Weeks

Kimbrel issued a one-out walk to Castro, before walking Derek Dietrich to create a bit of a jam. With just one out, Kimbrel gave up an RBI single to Magneuris Sierra (who carried a .170 batting average). And just like that, the score was once again tied.

It was Kimbrel’s fifth blown save of the season.

“As far as the pitching, yeah we need to get better. We know that. We weren’t good today,” manager Alex Cora said. “Too many pitches in the middle of the zone. We weren’t able to spin the ball we usually do, not able to pitch up in the zone we usually do. And we paid the price, but at the end, we won the game.”

“It has been. There’s no denying that,” Kimbrel said when asked about the shaky performances out of the bullpen of late. “But our team has been able to step up and keep winning through it. Going forward in the season, we’ve got a lot of games left, and if we’re going to be a successful team, we’re going to have to turn it around. And we know that. … Days like today aren’t any fun, but I can guarantee you we’re all going to show up tomorrow, wanting the ball, and ready to get out there and make up for today.”

The hard-throwing closer did escape the inning without further damage, giving Boston a chance for the walk-off in the bottom of the ninth.

Once again, it was Martinez who started the Red Sox’ rally, as he sent a one-out single into center field. Xander Bogaerts followed that up with a single of his own, setting up a first-and-second situation for Nunez with one out.

Nunez had launched a solo homer in the sixth and scored the tying run in the eighth, and he had this chance to make his night that much better.

Truth be told, Nunez didn’t exactly get the job done, as he chopped an 0-1 pitch to shortstop for what should have been a routine double play. But the throw from Riddle — in at shortstop — after tagging the second base bag was short, and first baseman Rojas couldn’t scoop it cleanly. In fact, he could barely get any leather on it at all. The throw went wild, and Martinez was able to trot home for one of the stranger walk-off wins of the season.

It wasn’t the most well-deserved Gatorade shower, but a win is — as they say — a win.

It will go down as a victory, but after scoring go-ahead runs courtesy of a wild pitch in the eighth and a shortstop’s throwing error in the ninth, it won’t go down as the greatest win in Red Sox history.

MORE NEWS: Friday Marks First Anniversary Of Boston Biogen Conference Super Spreader Event

“For whatever we are in the standings, whatever, we have a lot of margin to improve, which is very important,” Cora said. “We don’t get caught up on the whole, we got 91 wins. We know we have to be better. We know that and we keep working at it.”