After pounding the San Diego Padres 11-4 for a franchise-record 107th victory to top the 1904 New York team on Sunday, the San Francisco Giants won the NL West without needing to wait for the rival Dodgers’ result on the season’s final day.

Logan Webb did it all to lead San Francisco to its first division title since 2012, thrilling a frenzied, deafening crowd of 36,901 in the process. Buster Posey had a fantastic day as well.

Posey went out to the mound to hug reliever Dominic Leone and lifted both arms in the air when Eric Hosmer struck out swinging to finish the game.

ALSO READ | MLB Explainer: How the wild card tiebreakers work

After surrendering three straight hits, Webb was removed in the eighth inning to a thunderous standing ovation. He struck out eight batters and did not walk a hitter in seven-plus innings of work, and he also blasted a two-run homer in the fifth inning to clear the fences for the first time in his career – a beautiful line shot to left.

Posey scored his 1,500th career hit and drove in three runs on a pair of singles as San Francisco’s division chances came down to the last day. The Giants won Game 162 after falling 3-2 in 10 innings the day before in a night game against the NL Central champion Milwaukee Brewers.

The winner of Wednesday night’s wild-card game between the Dodgers and Cardinals will face the Giants in Game 1 of the National League Division Series on Friday at Oracle Park.

The Giants intended to earn it this way to dethrone the defending World Series champion Dodgers, who could have forced a Monday tiebreaker with a victory and a Giants defeat if they had won and the Giants lost. Since the Giants last won the NL West nine years ago, the Dodgers had won the last eight.

For the first time since 2017, San Francisco had baseball’s top record for 125 days and won on the last day of the regular season.

With inputs from the Associated Press