SAN FRANCISCO (CBS SF/AP) — The San Francisco Giants rewarded manager Gabe Kapler with a new contract after a record-setting season during which his team won a franchise-best 107 games and the NL West.

The extension announced Friday runs through the 2024 season. The 46-year-old Kapler has just completed his second season as manager.

READ MORE: Shoppers Welcome Heighten Police Presence In Downtown Walnut Creek

San Francisco edged the rival Dodgers on the final day of the regular season by one game before 106-win Los Angeles, which had won the previous eight division titles, eliminated the Giants in a thrilling five-game NL Division Series.

“Gabe has done an extraordinary job in his role as field manager over the past two seasons, is a key contributor to our front office, and the Giants organization takes great pride in his active engagement with the community,” president of baseball operations Farhan Zaidi said in a statement. “Coming off a season in which his work and leadership were instrumental to our success, it was a high priority for us to provide a level of stability and certainty to our continued partnership. We’re thrilled about today’s announcement.”

READ MORE: Police Officers Denied Service At San Francisco Restaurant Triggering Social Media Debate

Kapler replaced Bruce Bochy when Bochy retired following the 2019 campaign and immediately began doing things his way — bringing in a large coaching staff to support him. San Francisco went 29-31 during the coronavirus-shortened 2020 season.

Then the Giants surprised everybody this season by going 107-55 and winning the club’s first division crown since 2012 in a year when the Dodgers and San Diego Padres were the heavy favorites.

“I’m honored to work for the San Francisco Giants and I’m grateful for the opportunity to continue to build on the work of the last two years,” Kapler said. “There is nowhere I’d rather be, and I am excited to continue preparing with the entire organization.”

MORE NEWS: Long Lines Form Outside San Mateo Event Center COVID-19 Vaccination Site

© Copyright 2021 The Associated Press. All Rights Reserved. This material may not be published, broadcast, rewritten or redistributed.