DENVER (AP)Ryan McMahon’s third hit of the game was a tiebreaking solo homer in the bottom of the eighth inning, leading the Colorado Rockies to a 5-4 win over the San Diego Padres on Saturday night.

C.J. Cron and Charlie Blackmon also homered for the Rockies, who won their second straight after a seven-game home losing streak.

Manny Machado homered for the Padres, who lost their ninth in a row to the Rockies at Coors Field. It’s San Diego’s longest road losing streak to NL West-rival Colorado. The Padres slipped into second place in the division, a half-game behind the Los Angeles Dodgers.

McMahon, who came into the game batting .179 in the month of June with 21 strikeouts, capped his big game with the solo blast off Luis Garcia (4-4) that cleared the right-center field fence and dropped into the Rockies’ bullpen.

”That was great for Mac, great for us,” Rockies manager Bud Black said. ”Mac cares a lot. He wants to be the guy. It’s been a rough month or so for Mac, but tonight is what he is capable of.”

McMahon said he went back to basics, focusing on plate discipline and working to avoid chasing pitches out of the zone.

”I just tried to take my mind out of it and just go play the game,” he said. ”It’s the hardest thing to do. This game is very mental. It’s taxing on you, and sometimes you just have to stay out of your own way.”

The rewards, though, from his game-changing night at the plate were evident from the reception he received from his teammates once he returned to the dugout.

”There’s nothing like it guys, in the big leagues, helping your team win. Nothing compares to it,” McMahon said. ”That’s the best part of it all, getting back with the boys, everybody being happy for you and happy that the team just went up a run late in the game. Those are the moments you’re going to remember when you’re old and nobody else remembers that you played professional baseball.”

Alex Colome (2-0) pitched a scoreless eighth for the victory. Daniel Bard worked out of a two-on, one-out jam by striking out Machado and getting Luke Voit on an infield groundout for his 14th save in 16 chances.

Trailing 2-1, the Padres scored three in the top of the fifth off Colorado starter German Marquez to take a 4-2 lead. Jake Croneworth doubled ahead of Machado’s 12th homer of the season and the Padres added a third run on Nomar Mazara’s RBI groundout.

Colorado struck back in its half of the fifth, getting a two-run homer from Blackmon off San Diego starter Nick Martinez. The homer was the 202nd of Blackmon’s career, moving him past Dante Bichette for the sixth place in Colorado franchise history.

Blackmon also doubled in the first before a homer by Cron, his third in two games. San Diego got on the board with Voit’s RBI single in the top of the third.

TRAINER’S ROOM

Padres: Manager Bob Melvin, sidelined the past week by COVID-19, is feeling better and could return soon. ”He’s chomping at the bit to get back,” acting manager Ryan Flaherty said. ”He’s asymptomatic and awaiting on (test) results. He’s ready to get going.”

UP NEXT

Colorado RHP Antonio Senzatela (2-3, 4.79 ERA) is slated to start Sunday’s series finale against San Diego. He has gone 5-1 in 10 games, including seven starts, against San Diego at Coors Field. He’ll be opposed by San Diego LHP Blake Snell (0-3, 5.04 ERA).

More AP MLB: https://apnews.com/hub/mlb and https://twitter.com/AP-Sports