SAN FRANCISCO (AP)Mike Yastrzemski hit a game-ending grand slam off major league saves leader Josh Hader for San Francisco’s third homer of the ninth inning, and the Giants rallied from a three-run deficit to stun the Milwaukee Brewers 8-5 on Friday night.

Hader was tagged with his second straight loss, two nights after giving up a walk-off, three-run homer to Minnesota’s Jose Miranda in the ninth inning. The All-Star closer failed to retire a batter in that one.

”Right now it’s everything,” Hader said. ”I feel like I’m trying to feel things that I don’t need to. I lost that aggressiveness that I normally have. I just have to chalk it up and move on.”

Hader (0-4) again had trouble keeping the ball in the park.

Joey Bart started the comeback in the ninth with a leadoff home run. After pinch-hitter Wilmer Flores flied out, Darin Ruf connected to make it 5-4.

Austin Slater followed with his fourth hit of the night and Hader hit Yermin Mercedes with a pitch before Thairo Estrada’s bloop single loaded the bases.

Yastrzemski then drilled the first pitch he saw from Hader to center field, with Estrada pumping his fists in celebration before the ball even cleared the fence.

”I was just ready for a fastball, ready to get something in the zone,” Yastrzemski said. ”I just wanted to get it to the outfield and hoped that we could get one run in to tie the game. It was nice that it worked out that way.”

Brewers manager Craig Counsell noted that Hader’s best pitch can sometimes be his downfall.

”He’s lived with a great fastball; hitters know that a fastball’s coming,” Counsell said. ”He’s not making a lot of pitches right now. He’s searching to make pitches. Location is obviously an issue, that’s number one. We’ve got to get to work and help him out.”

It’s the first time this season the hard-throwing lefty has allowed home runs in back-to-back appearances.

”The good thing about Josh is that he has the right mindset for that closer’s job and he understands that role so well,” Milwaukee starter Brandon Woodruff said. ”It’s a hard game, stuff happens. I know he’s upset. He’ll be just fine.”

LaMonte Wade Jr. also homered for the Giants, who have won five of seven. Sam Long (1-2) got three outs for the win.

Andrew McCutchen continued his surge at the plate with a three-run double for the Brewers. McCutchen is batting .323 (43 for 133) with 22 RBIs in his last 34 games after a 1-for-40 slump.

Woodruff matched his career high of five walks and pitched with runners on base most of the game, but repeatedly worked out of trouble. He allowed two runs and five hits with four strikeouts in 5 2/3 innings.

GOOD AND BAD GLOVE WORK

David Villar turned in a pair of defensive gems in the third inning to highlight his second consecutive start at third base for the Giants. Villar made a leaping grab of Jonathan Davis’ sharp liner, then followed with a barehanded grab and throw for the out on Willy Adames’ slow grounder. Villar was also charged with an error in the sixth when he cut in front of shortstop Brandon Crawford and dropped Kolten Wong’s popup.

IN THE WAY

Wong reached on an infield single leading off the third when Wade and Giants starter Alex Wood collided near first base line trying to make a play. Wood grabbed the ball with his glove and reached over a crouching Wade to attempt the tag, but couldn’t get close enough.

TRAINER’S ROOM

Brewers: Christian Yelich, who scored the winning run Thursday as a pinch-runner, was back in the starting lineup batting leadoff after missing three games with back tightness.

UP NEXT

Brewers LHP Eric Lauer (6-3, 3.83 ERA) is unbeaten in eight career games against San Francisco. The Giants counter with RHP Alex Cobb (3-4, 4.57), who is looking for his first win since May 17.

More AP MLB: https://apnews.com/tag/MLB and https://twitter.com/AP-Sports