For one last time a long season for the Padres intertwined with an even longer season for the Diamondbacks.

The Padres on Thursday concluded their home schedule with their 15th extra-inning game of the year. It doubled as Arizona's majors-leading 25th.

It ended in striking fashion a memorable bookend to an at-times forgettable season at Petco Park.

Alexi Amarista sent a bases-loaded walk-off single up the middle in the 11th and the Padres celebrated a 3-2 victory. Before they finish the season with three games in San Francisco they finished 45-36 at home.

"We've talked about that as a group about playing well here" Padres manager Bud Black said. "I think any team will tell you that they feel better at home. It's good to see we did it on the field."

The results haven't been there on the road. The Padres have three more chances to improve on their 30-48 mark away from Petco Park. At 75-84 overall they are a win from at least tying last season's record.

Amarista's game-winning hit was set up by a leadoff single from Tommy Medica. The next batter pinch-hitter Jesus Guzman cranked a towering fly ball to center. Diamondbacks outfielder A.J. Pollock lost the ball in the sky and it bounced once and into the bullpen for a ground-rule double.

"It was like going into a room and someone turned the lights out on you" Pollock said. "It's a helpless feeling. I'm playing a guessing game where he hit it."

It was an understandable feeling too. The sun had begun to set making for a tricky backdrop.

"It's really just the twilight" Padres center fielder Will Venable said. "The ball goes above the stadium and you literally can't see it."

After Guzman's double Nick Hundley was intentionally walked by Josh Collmenter bringing Amarista to the plate with no outs.

Amarista delivered on a 2-2 changeup securing a sixth win for Nick Vincent.

It was the ninth walk-off hit of the season for the Padres who moved to 8-7 in extra-inning contests.

Padres pitchers retired 24 consecutive batters to finish the game. Relievers Luke Gregerson Huston Street and Vincent combined to throw four perfect innings following a strong performance by Robbie Erlin in the ninth and final start of his debut season.

Facing an Arizona offense featuring MVP candidate Paul Goldschmidt Erlin tied his career high with seven strikeouts over seven innings. He yielded two runs on three hits.