SAN DIEGO – After spending much of the night chasing, the San Diego Padres clinched their spot in the MLB Postseason when Freddy Fermin hit a walk-off single to top the Milwaukee Brewers 5-4 in 11 innings on Monday night.

The catcher acquired by the Padres (86-71) at the trade deadline delivered the eighth walk-off win of the season, scoring ghost runner Bryce Johnson after Jose Iglesias executed a sacrifice bunt off reliever Grant Anderson.

MLB-leading Milwaukee (95-62) dropped just their sixth game of the season where they led after the sixth inning, and had loaded the bases against reliever Bradgley Rodriguez, but the rookie escaped the jam by getting an inning-ending double play and earned his first career win.

For the fourth time in six seasons the Padres will be playing in October, and it marks the second time in franchise history that the Brown and Gold will be in the Postseason back-to-back years — joining the 2005 and 2006 teams.

The teams traded runs in the 10th inning, with Gavin Sheets bagging the tying RBI on a fielder’s choice groundout off reliever Rob Zastryzny, but the Padres left the bases loaded. Milwaukee converted their ghost runner against reliever Adrian Morejon when Sal Frelick reached on an RBI fielder’s choice.

San Diego spent the majority of the game trailing, but shortstop Jose Iglesias served as a spark plug to help the Padres rally from an early 3-1 deficit.

Iglesias started a two-out rally in the seventh inning, working a walk off reliever Nick Mears. Then Ramón Laureano, who was not in the starting lineup as part of a scheduled off day, pinch hit and drew a walk to set the table for Luis Arraez, who made like the sprinkler on the giveaway bobblehead figure and lined a game-tying RBI single to right-center field.

Limited runners in scoring position chances would be the theme through the first six innings, as the Padres generated only two RISP at bats and both came in the first inning.

San Diego loaded the bases on back-to-back one-out singles by Manny Machado and Jackson Merrill, then Ryan O’Hearn drew a two-out walk. A balk by Brewers starter Freddy Peralta scored a run, but that would be all as a flyout ended the threat.

Milwaukee responded by getting three of their first four batters on base in the second, with starter Nick Pivetta allowing two of the three to reach on walks. Caleb Durbin hit an RBI single with one out, then Christian Yelich sharply lined a two-out, two-RBI hit to center field, which Merrill rallied to Iglesias and the shortstop quickly fired it to Machado to get Durbin for the final out of the inning.

At the dish Iglesias would hit a single to left field in the second, then after Peralta retired eight consecutive Padres, led off the fifth with a home run. Iglesias turned on an inner-third fastball, crushing it to the second deck in left field for his second long ball of the season to trim the deficit to one.

Pivetta battled his way through 5 ⅔ innings, working around a season-high five walks and allowing four hits and three runs with five strikeouts. However, outside of the second inning where the Brewers plated all of their runs, Pivetta allowed just one other RISP opportunity.

San Diego used six different relievers, getting an inning from Ron Marinaccio, Jeremiah Estrada, Robert Suarez and Morejon, in addition to ⅓ an inning from Kyle Hart. The pitchers worked around eight walks and struck out 11 — three of the seven games where the pitchers have walked a combined eight or more have come in September.

The Padres were without two of their three regular outfielders, with Fernando Tatis Jr. missing the game due to an illness as well as Laureano.

For the second game of the series, San Diego will start Randy Vásquez (5-7, 3.94 ERA) while Milwaukee has yet to name a starter. First pitch is scheduled for 6:40 p.m. at Petco Park.

This story will be updated.