DENVER (AP) — Brendan Rodgers and Ryan McMahon hit back-to-back home runs in a six-run seventh inning, and the Colorado Rockies held off the St. Louis Cardinals 8-6 on Thursday to secure their first series win since the All-Star break.

The Rockies overcame three more hits from Paul Goldschmidt, including his 27th home run, to improve to 7-14 since July 22.

Former Rockies slugger Nolan Arenado hit his 24th home run to extend his hitting streak to nine games, but struck out looking with two on in the ninth to end it for the Cardinals. They lost for the second time in three tries since winning seven straight.

Jordan Hicks (3-6) walked two with one out in the seventh and was relieved by Génesis Cabrera. Charlie Blackmon pulled a grounder through the right side to snap a 2-all tie and José Iglesias followed with an RBI single up the middle.

Rodgers then belted a first-pitch changeup an estimated 407 feet. The three-run homer made him 10 for 19 over his past four games.

“He kind of pulled a changeup and it cut on him a little,” Rodgers said. “It’s a big homer against a really good team. A good series win.”

McMahon’s solo shot to right ended the day for Cabrera, who threw just 13 pitches.

“Tough outing. Obviously goes in and can’t record an out,” Cardinals manager Oliver Marmol said. “Just overall not like him.”

Goldschmidt, who improved his NL-leading batting average to .332, hit a two-run homer and Arenado followed with a solo shot in the eighth off Alex Colomé. The Cardinals, who also got a solo home run from Nolan Gorman, saw their lead over Milwaukee in the NL Central sliced to a half-game ahead of their three-game series in St. Louis starting Friday.

Brian Serven added a two-run double and Lucas Gilbreath (1-0) pitched a perfect seventh for Colorado. Daniel Bard loaded the bases with one out in the ninth, but got Goldschmidt to ground into an RBI forceout before getting Arenado with a slider on his 30th pitch for his 24th save in 26 chances.

Cardinals starter Dakota Hudson allowed four hits and four walks in five innings, while Rockies right-hander Germán Márquez worked around eight hits and struck out six. He got out of a jam in his sixth and final inning when he fanned Paul DeJong and Tyler O’Neil with runners on second and third.

“My slider was very good today,” Márquez said.

WINNERS WITH BRYANT?

Rockies OF Kris Bryant remained in a walking boot Thursday with left plantar fasciitis. That and earlier back trouble have limited Bryant to 42 games after he signed a $182 million, seven-year free-agent deal in March.

Bryant said he’s not had a discussion about shutting it down for the season, but has ruled out a cortisone shot to get back sooner because it only masks the problem.

“It’s something I didn’t want to risk because I don’t want to walk flat-footed the rest of my life,” Bryant said.

After not selling at the trade deadline, manager Bud Black believes the Rockies can contend for a playoff spot in 2023 with a healthy Bryant and other players staying healthy and meeting expectations.

“I think we’d have a really good team that could play with anybody,” Black said.

TRAINER’S ROOM

Cardinals: RHP Jack Flaherty (shoulder) allowed four runs — three earned — in one inning while throwing 35 pitches in a rehab start for Triple-A Memphis. One of his four hits allowed was a home run. He struck out two.

Rockies: CF Yonathan Daza made a running catch of Arenado’s fly to right center in the first, then tumbled to the ground on his left shoulder. The right-handed Daza said he popped his shoulder back into place before being assisted off the field through the Rockies’ bullpen. “It happened before in Double-A,” said Daza, who hopes to avoid the injured list. … Black said an MRI on C Elias Díaz’s left hand showed ligament issues a day after he was injured on a swing. He could face IL time.

LINEUP WRINKLES

After homering and collecting four hits Wednesday while playing first base, St. Louis’ Albert Pujols had the day off in his last appearance at Coors Field. Pujols began his major league career in Denver on April 2, 2001, going 1 for 3.

The retiring Pujols’ next game will be his 3,035th and move him past Ty Cobb for fifth in major league history.

A day after tripling twice, Lars Nootbaar led off with a double in his first game atop the Cardinals’ order. Tyler O’Neill, who struck out four times, started in center field ahead of struggling Dylan Carlson.

UP NEXT

Cardinals: LHP Jordan Montgomery (4-3, 3.53 ERA) starts Friday night against Milwaukee LHP Eric Lauer (8-3, 3.59).

Rockies: RHP Antonio Senzatela (3-6, 4.68) starts Friday night at Coors Field against Arizona RHP Zach Davies (2-4, 4.03) as Colorado seeks consecutive wins for the first time since July 15-16.