The Braves paid Josh Donaldson $23 million for swings like Sunday’s.

An afternoon of offense favored the Rockies, 6-5, in the eighth. The Braves had two on with two out, Donaldson at the plate. Three pitches later, he skied one into the outfield seats.

Thanks to Donaldson’s heroics, the Braves avoided a sweep, defeating Colorado, 8-7. It snapped the Rockies’ eight-game winning streak in Atlanta and provided a feel-good win the Braves surely needed.

“Just a back and forth game all day,” first baseman Freddie Freeman said. “Offense came to play on both sides. And when you thought it was going to happen again, a tough (loss), Josh came up with a huge hit right there. That’s how you build momentum, turn the season around and get on a nice little hot streak.”

Attention has centered on the struggling bullpen, putting more pressure on the Braves’ offense to deliver. It did enough Sunday, with four homers.

Ozzie Albies had one of his dynamic days that brings back memories of last April. He belted a lead-off homer and cranked out another in the third to tie the game. He has five homers, tied with Freeman and Donaldson for second-most on the club (Ronald Acuna, six).

Speaking of Freeman, his own solo shot extending his on-base streak to 27, tied for the longest mark to begin a season in Atlanta-era franchise history. In a season that’s hoisted no shortage of inconsistencies, the Braves can at least rely on Freeman’s steady hand.

But Donaldson deserves the spotlight. He’s had an average start, with spurts of power scattered between loud outs. There are times when he’s showcased his MVP resume, though not at the length for which fans have clamored.

His signature moment came in the ninth, when he awarded the Braves a much-needed win to stop a five-game home skid and provide a swift reminder that this team is as tenacious as any.

“It’s nice to see that right-field porch work to our advantage for a change,” manager Brian Snitker said. “He had good at-bats all day. He always stays in the count, he doesn’t chase a lot. He’s not afraid to take his walk, and he’s had some big walks. It’s important. I’m sure it’s good for him to get a big hit like that.”

That marked Donaldson’s 12th career go-ahead homer in the eighth inning or later. He’s collected an extra-base hit in 11 of his last 18 games, with six of his last eight hits going for more than one bag.

If Donaldson played Batman, Luke Jackson was Robin. A.J. Minter, in an effort to close the game, walked Mark Reynolds and induced a force out from Charlie Blackmon. Snitker decided to play the match-ups, lifting his usual closer in favor of Jackson.

Jackson, who’s been marvelous since his opening day meltdown, retired Nolan Arenado and David Dahl to secure the win. He ran his scoreless streak to 13 innings across 12 appearances.

“I really don’t remember much,” Jackson said of the inning, panting and wiping sweat from his face. He rode his adrenaline to register the biggest two outs of his Braves tenure.

It’s safe to say the Braves are happy they didn’t give up on him too soon. They clung to the 27-year-old through his command problems.

“I struggled day 1, but I felt great,” Jackson said. “Stuff was good. It’s a weird game where a ground ball through the hole can be a three-run inning or a ground ball through the hole can be a double play. So it’s one of those games you go out there and make enough pitches, eventually it goes your way if you’re making good ones.”

Jackson’s turnaround has saved an otherwise uninspiring bullpen. At a time seemingly everyone else is working out the kinks, Jackson hit his stride.

As a result, his fellow bullpen arms nicknamed him the “friendly neighborhood Slider-Man,” a reference to how devastating his slider has become.

Whether his transformation is permanent or temporary, it’s been about the only bright spot of a bullpen that’s suffered from an inability to throw strikes.

“His best right now is very hard to beat,” Freeman said. “When you see Luke coming in, you feel like you have a pretty good chance to win this game. Ever since opening day, he’s been pretty much lights out. So when he came in, we had all the confidence in the world we were going to win that game.”

Kevin Gausman, starting for the first time against his hometown team, took a beating. After a pair of scoreless innings, his undoing began in the Braves’ usual fashion: A walked hitter.

Tony Walters took his base and was bunted over by pitcher Tyler Anderson. Blackmon singled him home before Trevor Story’s double placed two in scoring position. Daniel Murphy took Gausman deep, his second homer in as many days, and a 3-0 lead transformed into a 4-3 deficit.

The teams traded sacrifice flies after Albies’ second homer, creating a 5-5 tie in the fourth.

Gausman gave way to Dan Winkler for the sixth. And just as Story did a night ago, Ian Desmond homered off Winkler, putting the Rockies ahead. Desmond, who was having a horrific year entering the series, was a thorn in the Braves’ side, notching a couple hits and scoring two runs.

For as criticized as the bullpen is, the Braves’ failure with runners in scoring position was also to blame for their struggles. They were 6-for-50 in that category in the past five games. Johan Camargo stranded five in two innings Sunday. Donaldson’s shot bailed them out in a contest that again could’ve been squandered by missed opportunities.

“Our offense, they come back, they keep fighting, grinding,” Snitker said. “That’s who they are. That’s how they’re wired. They never make excuses. They hang in there with their teammates. They have each other’s backs, which is a really good thing. I don’t hear anyone (complaining) about what’s going on. They’re out there trying to win a game every day.”

The Braves host the now-formidable Padres for four before embarking on a three-city trip (Miami, Los Angeles, Arizona) on Friday.