SAN FRANCISCO (AP) Rookie David Villar hit a two-run, bases-loaded single with nobody out in the 10th inning to give the San Francisco Giants a 4-3 victory against the Arizona Diamondbacks on Sunday, a dramatic finish to the final game of the season at Oracle Park.
The win also kept alive the Giants' hopes of a winning season, raising their record to 80-79 with three games remaining in San Diego.
Austin Slater homered for the Giants and Evan Longoria contributed a sacrifice fly in what might have been his final home game in San Francisco.
Longoria's status for the Padres series is questionable as well. He took a bad-hop grounder off his bare hand in the top of the 10th and was going to give way to a pinch-hitter had Villar not won the game in the spot ahead of him.
Longoria is completing his fifth year with the Giants and the final guaranteed season of the 10-year, $100 million contract he signed with the Rays in 2012. The Giants hold a $13 million option for 2023, but the third baseman turns 37 on Friday and the club has expressed a desire to get younger and more athletic after a disappointing season.
Villar is part of those plans, with manager Gabe Kapler calling him an ''important part of our future.''
The 25-year-old said he understood what his walk-off hit meant to fans as the final moment of a season at a ballpark where the Giants did not win nearly as much as they had hoped coming off a 107-win division championship.
''I think there's a lot of good things we saw today and throughout the season,'' he said. ''Head over to San Diego, try to take these three games and head into the offseason happy.''
The Diamondbacks, who twice came from behind to tie the game, took a 3-2 lead in the 10th.
Jharel Cotton (4-2) began the inning by getting Carson Kelly to pop up a bunt. Jake McCarthy's third hit, a single to right, scored automatic runner Daulton Varsho to break a 2-2 tie.
But with two runners in scoring position, Cotton struck out Josh Rojas and retired Pavin Smith on a flyball to prevent the Diamondbacks from adding to their lead.
Taylor Widener (0-1), trying to earn his first major league save, walked leadoff hitter Wilmer Flores before J.D. Davis' infield single loaded the bases with nobody out in the 10th.
Villar grounded Widener's first pitch through the hole into left field, scoring automatic runner Mike Yastrzemski and Flores, who slid home as the catcher Kelly could not handle Corbin Carroll's throw.
Slater hit the sixth pinch-homer of his career off lefty Caleb Smith to start the seventh inning and break a 1-1 tie.
The Diamondbacks retied it at 2 in the eighth on McCarthy's leadoff single and Rojas' RBI double against John Brebbia.
Giants closer Camilo Doval and former Giants reliever Mark Melancon each pitched a perfect ninth to send the game into extras.
Arizona starter Zach Davies pitched five innings and held the Giants to one first-inning run despite allowing two hits and walking five.
San Francisco loaded the bases in the first on Flores' double, a walk by Davis and Joc Pederson's single before Longoria's one-out sacrifice fly.
Pederson also might have played his final home game for the Giants. Pederson, a native of nearby Palo Alto whose 70 RBIs rank second on the team behind Flores' 71, is completing a one-year contract and will return to free agency this winter.
After the Diamondbacks wasted several opportunities to score early in the game, they tied it 1-1 in the fifth on two-out doubles off Alex Young by Kelly and McCarthy. But overall they stranded 10 runners and went 3 for 17 with runners in scoring position.
''I was proud of the way the guys fought today,'' manager Torey Lovullo said. ''We had a ton of opportunities. Unfortunately, we couldn't get the big hit; we'll be better tomorrow.''
Diamondbacks: INF Emmanuel Rivera went on the 60-day injured list with a left wrist fracture, two days after the injury was diagnosed. Arizona also moved infielder Ketel Marte to the 10-day IL for undisclosed reasons. ... Selected the contract of INF Jake Hager from Triple-A Reno to provide depth.
Giants: Opening day starter Logan Webb went on the 10-day injured list with a low back strain on the day he was supposed to make his final 2022 start. Kapler said Webb could have pitched, but also cited Webb's workload this year and the need to protect him for 2023. The 25-year-old set career highs in starts (32) and innings (192 1/3) while posting a 15-9 record and 2.90 ERA.
Giants: Recalled RHPs Sean Hjelle and Luis Ortiz from Triple-A Sacramento to provide additional bullpen coverage for the final four games. They replaced Webb, who went on the IL with a low back strain, and RHP Jakob Junis, who threw 83 pitches Saturday and was not likely to return to the mound this season.
The Giants finished their home schedule 44-37. They also went 32-41 against the NL West after going 52-23 in division games last year. The Diamondbacks were 29-48 in division play.
The Giants drew a total of 2,482,686 fans for their home games this season. In 2019, the last season before COVID-19 restrictions, they drew 2,707,760.
Diamondbacks: Arizona wades into the race for the final NL wild-card spot when it begins a three-game series at Milwaukee on Monday night. The Brewers are two games behind the Phillies for the final slot with three games remaining. LHP Tommy Henry (3-4) starts the opener for the Diamondbacks against RHP Brandon Woodruff (13-4).
Giants: The Giants open their final series of the season in San Diego on Monday night with a bullpen game. RHP Joe Musgrove (10-7) starts for the Padres, who clinched a wild-card spot Sunday.
More AP MLB: https://apnews.com/hub/MLB and https://twitter.com/AP-Sports
Copyright 2022 STATS LLC and Associated Press. Any commercial use or distribution without the express written consent of STATS LLC and Associated Press is strictly prohibited.