Manny Machado turned a one-run deficit into a two-run lead with one swing, and San Diego turned its 90th victory into a home playoff series. The Padres beat Arizona 10-7 Saturday night at Petco Park, clinching the National League's No. 4 seed and a Wild Card Series matchup with the Chicago Cubs.

Arizona had moved ahead 4-3 on James McCann's two-run homer in the top of the fourth. In the bottom half, Machado drove a three-run shot to right with Ethan Salas and Fernando Tatis Jr. aboard. His 30th home run of the season gave San Diego a 6-4 lead it never surrendered.

The milestone carried two layers. It was Machado's eighth career 30-homer season and his fourth with the Padres, tying Adrián González for the most such seasons in franchise history, according to MLB's game recap. It was also career home run No. 399, placing another round number within one swing as the regular season closes.

San Diego kept adding. Xander Bogaerts hit a solo home run in the fifth. Tatis brought home Jake Cronenworth with a groundout later in the inning, then Cronenworth drove a two-run single through center in the sixth. A 4-3 deficit had become a 10-4 cushion over three consecutive trips to the plate.

The teams had traded runs before the power arrived. Jackson Merrill singled home Dustin Harris in the first. Arizona tied the game in the second after a throwing error, then Gabriel Moreno's third-inning single put the Diamondbacks ahead. Ty France's groundout and Gavin Sheets' double reclaimed the lead for San Diego before McCann's homer reversed it again. Machado's swing was the fifth lead-changing sequence in four innings.

The bottom of the order and table setters shared the work. Jackson Merrill and Dustin Harris each scored twice and collected two hits. Salas had two hits and scored ahead of Machado's homer. Cronenworth finished with two hits, two runs batted in and a run. Machado went 2-for-5 with three RBIs.

Walker Buehler did not complete the fourth inning, allowing four runs, three earned, on five hits and one walk in 3 2/3 innings. Yuki Matsui recorded the final out of the fourth and received the win. Bradgley Rodriguez, Adrián Morejón and David Morgan combined for four scoreless innings before Arizona mounted a ninth-inning rally.

Mason Miller allowed three runs on three hits and two walks in the ninth but struck out Ildemaro Vargas to end it. The late traffic shortened the cosmetic margin, not the result. The Padres finished with 13 hits and overcame their only error; Arizona had 10 hits and left nine runners on base.

The win lifted San Diego to 90-71 and secured a third consecutive 90-win season. MLB reported that the Cubs will return to the matchup after eliminating the Padres in last year's Wild Card round, but this series begins at Petco Park. Game 1 is Tuesday. Saturday supplied the preferred setup: a middle-of-the-order swing changed the game, multiple hitters extended the lead, and the club earned the right to start October without packing for a flight.