Brandon Belt hit the third pitch of the bottom of the first inning for a two-run home run, and Madison Bumgarner threw a dominant seven innings Friday night, highlighting the San Francisco Giants’ 8-3 victory over the visiting San Diego Padres.

Belt finished with three RBIs, Buster Posey had three hits, and Mike Yastrzemski homered and scored three times for the Giants, who drew even in the four-game series of National League West clubs after having lost 5-3 on Thursday night.

Belt’s homer came two pitches after an error on Padres first baseman Eric Hosmer allowed Yastrzemski to reach base on Padres starter Dinelson Lamet’s first delivery.

The homer was Belt’s 16th of the season.

Yastrzemski countered a Manny Machado solo home run in the fourth inning with one of his own in the fifth, allowing the Giants to regain a two-run lead and setting the stage for late offensive fireworks that made the game a blowout.

Evan Longoria had RBI hits in both the seventh and eighth innings, his run-scoring single contributing to a three-run seventh before his RBI double capped a two-run eighth that made it 8-2.

Bumgarner (9-8) allowed only one run, on Machado’s 28th homer, while giving up four hits and two walks. He struck out nine.

The win improved the Giants ace’s record to 6-1 in his past 13 starts.

The Padres’ other runs came against the San Francisco bullpen in the eighth and ninth innings. Austin Hedges tripled and scored in the eighth, and Hosmer singled home Machado in the ninth.

Lamet (2-3) struck out 10 in five innings, during which he was charged with three runs (two earned) on three hits and two walks.

Belt matched Posey with three hits, and Yastrzemski and Longoria had two apiece for the Giants, who snapped a three-game losing streak.

The Giants out-hit the Padres 13-7.

Machado had a double and a homer and scored twice for San Diego, which lost for the third time in four games.