OAKLAND, Calif. (AP) — Matt Chapman hit a two-run home run off struggling closer Josh Hader in the eighth inning to break out of a long slump and the Oakland Athletics beat the Milwaukee Brewers 5-3 Thursday.

The A’s trailed 3-2 when Robbie Grossman walked leading off the eighth against Hader, an All-Star reliever who pitched for a third consecutive day for the first time in his career. Chapman, who had one hit and 13 strikeouts in his previous 30 at-bats, crushed a first-pitch home run to straightaway center. Jurickson Profar added a sacrifice fly off Jay Jackson.

It’s the third blown save and 11th home run allowed by Hader (1-5). He also gave up Matt Olson’s walkoff home run on Tuesday. Hader has a 5.40 ERA and five homers allowed in 11 appearances since July 1.

Chad Pinder also went deep and Mark Canha added three hits to help the A’s win their fourth in five games.

Christian Yelich doubled to extend his hitting streak to a career-high 19 games for Milwaukee, matching the longest streak in the majors this season. Mike Moustakas added two hits, and Trent Grisham had a sacrifice fly in his major league debut with the Brewers.

Blake Treinen (6-3) retired three batters to win, and Liam Hendriks pitched the ninth for his 10th save.

Oakland began the day a half-game behind Tampa Bay for the second AL wild card.

STARTING OFF

Oakland’s Homer Bailey struck out five in six innings but had three walks and allowed two runs in his fourth start for the A’s since being traded from Kansas City on July 14.

Brewers starter Chase Anderson struck out five, walked two and allowed two hits in six innings. He got Profar to ground out with a runner at third to end the second, gave up Pinder’s homer leading off the third, then settled in to retire 12 of the final 15 he faced.

MOVES AND DEBUTS

Grisham went 0 for 3 after being called up from Triple-A San Antonio but collected his first RBI with a sacrifice fly off Bailey in the fourth. Milwaukee right-hander Taylor Williams and infielder Taylor Saladino were optioned to San Antonio. Pitcher Jacob Barnes was designated for assignment.

TRAINERS ROOM

Brewers: Gio Gonzalez threw a bullpen and was cleared to start Saturday against the Cubs. Gonzalez left his previous start against Chicago with tightness in his left shoulder and there was concern he might have to go on the injured list.

Athletics: Stephen Piscotty had two hits and scored a run in a rehab start with Triple-A Las Vegas and is expected to rejoin the big league club in time for Saturday’s game against his former team St. Louis. Piscotty has been out with a sprained right knee since June 30. … Marco Estrada (lumbar strain) said before the game that he might make one more rehab start with Class A Stockton. The right-hander hasn’t pitched since April 16.

UP NEXT

Brewers: RHP Zach Davies (8-4, 3.56 ERA) faces the Chicago Cubs for the fourth time this season in the series opener at Wrigley Field on Friday. Davies, who lost to the Cubs last Sunday, has allowed seven runs in each of his previous two starts overall.

Athletics: RHP Miker Fiers (9-3, 3.54) takes a career-high seven-game winning streak into Saturday night’s interleague game against the St. Louis Cardinals. Fiers has left with the lead in six of his eight no-decisions this season.