DENVER — The Padres came down from the mountains with the margin they need after winning on Thursday by a large margin.

With a 9-2 victory over the Rockies, the Padres increased their lead in the race for the final National League playoff spot to four games with nine games remaining in the regular season.

That lowered the Padres’ “magic number” to six, meaning any combination of Padres wins and Diamondbacks losses that add up to six assures the Padres a postseason berth.

If they maintain at least the four-game margin over the next six games, the season-ending three-game series against the Diamondbacks at Petco Park will not be a showdown to see which of the two teams advances.

“I think that was our goal going in,” Padres manager Craig Stammen said after the conclusion of a 6-1 road trip. “You want to clinch as quickly as possible. So we’ve got six big games before we play the Diamondbacks, and we’ve got to take care of business in those six games just like we did on this road trip.”

The Padres might still have something to play for that final weekend, as they have moved to a game behind both the Phillies and Cubs in the wild-card chase. If they can pass both, the Padres would host the best-of-three Wild Card Series.

Before facing the Diamondbacks, the Padres will play the Marlins at home and the Dodgers in Los Angeles over the next week. It will be a step up in competition from the Nationals, Giants and Rockies, their past three opponents and owners of a collective .416 winning percentage.

But a team never leaves Coors Field taking a victory for granted.

“This was a big game for us,” Xander Bogaerts said. “I mean, every game is big. Take one at a time, but this was definitely one that, knowing this ballpark, things can get tricky.”

The Padres’ 10th victory in their past 11 games was just slightly more nonsensical than the typical absurdity in the Rockies’ gargantuan mile-high ballpark.

The centerpiece of Thursday’s madness was a season-high seven runs in the second inning.

In all, the Padres hit three triples, their most since 2020. They had eight extra-base hits, which tied their season high. Their 28 total bases were their third-most this season and their most since 2011 in a game in which they hit just one homer.

And Bogaerts came within a single of hitting for the cycle.

“Offense put up nine,” Padres starting pitcher Michael King said. “Makes my job a lot easier.”

King (12-9, 3.03) was about the only one on the field who behaved as if the game was not being played where it was.

The right-hander turned in his eighth consecutive quality start by getting through six innings while allowing just two runs.

It was difficult to recall that the Padres actually trailed at the start.

They made that a quick circumstance with their most prolific inning of the season.

As is the case more often at Coors Field than anywhere else, it was difficult to keep up with all the hitting and running and scoring and weirdness that came in a flurry.

Bogaerts homered on Tanner Gordon’s first pitch in the second inning and tripled on Gordon’s 38th pitch of the inning. The Padres sent 11 batters to the plate in the second. Every one of them reached base except Luis Campusano, who made the first and third outs, and Manny Machado, whose sacrifice fly was the middle out.

The inning could have ended three runs and two fortunate triples before it did.

But on Jackson Merrill’s bloop hit to shallow right field, Zac Veen ran in, slid and had the ball go in and out of his glove. Merrill raced to third while the two runners who were on base ran home.

Bogaerts followed Merrill to the plate and lined a sure single that Veen tried to catch with a dive, only to have the ball hit the grass in front of him and roll to the wall as Bogaerts made it to third.

The Padres were rid of Gordon after three innings and scored twice against Zach Agnos in the fifth when Jake Cronenworth led off with a triple, Samad Taylor doubled and Dustin Harris hit his third single of the game.

That was ample cushion, even at Coors Field, because King was almost finished allowing runs.

The Rockies scored against him before he made an out when Jake McCarthy led off the bottom of the first with a triple and Connor Norby singled.

But King retired 15 of the next 17 batters before the Rockies scored on a pair of singles and a walk with two outs in the sixth inning.

A second walk loaded the bases after the run scored and, down to his final batter, King struck out Troy Johnston to finish off his outing on his 104th pitch.

Yuki Matsui worked the seventh and Griffin Canning the final two innings.

By then, the only question was whether Bogaerts, who had bounced a ground-rule double over the wall in left-center field in the fourth inning, would get the fourth cycle in Padres history (and the third at Coors Field). Strikeouts in the sixth and ninth kept him short.

“That one might sting a little bit,” Bogaerts said.

The pain will be short-lived. It has to be.

The Padres headed home to play the Marlins in a series that begins Friday. It was the Marlins that helped out the Padres this week by winning two of three in Arizona. They are a better team with better pitching than the Rockies, who are now three defeats from their fourth consecutive 100-loss season.

“Obviously we’re playing really good baseball right now,” King said. “It’s not like we take a four-game lead for granted. We still got to go take care of the Marlins now, and it’s that one-game-at-a-time mentality of win the game we’re playing, and we’ll see what’s going on after that.”