Tommy Gilligan-USA TODAY Sports

Adley Rutschman homered to lead off the bottom of the ninth inning to give the Baltimore Orioles an 8-7 walk-off victory against the visiting Oakland Athletics on Thursday afternoon.

Rutschman hit Trevor May's first pitch over the fence in right-center field for his fourth home run of the season. It was Rutschman's only hit of the game.

It capped a back-and-forth game and gave Baltimore three wins in the four-game series.

Ryan Mountcastle also hit a home run and Ryan O'Hearn drove in three runs in his Orioles debut.

Brent Rooker homered twice and drove in five runs for the Athletics.

Felix Bautista (1-1) was the winning pitcher with one inning of shutout relief. May fell to 2-2.

Oakland scored in the first inning in every game of the series. This time, its first run came on Rooker's sacrifice fly.

The Orioles led 7-4 after three innings, but Oakland responded with two runs in the fourth and tied the game on Rooker's second homer of the game -- third of the season -- in the fifth. Rooker smashed a three-run shot in the third.

O'Hearn had a two-run single in the second inning and a go-ahead sacrifice fly in the third.

Austin Hays posted three hits and two runs and Jorge Mateo knocked in two runs for Baltimore.

Oakland's Esteury Ruiz went 3-for-4.

Tied 7-7, the Orioles appeared ready to take the lead in the bottom of the eighth with runners on second and third base and no outs. But Mateo popped out and Cedric Mullins' fly ball to right field turned into an inning-ending double play when Ramon Laureano threw out Terrin Vavra at the plate.

Athletics starter Adam Oller was charged with seven runs on eight hits in 2 1/3 innings. Adrian Martinez gave Oakland 3 2/3 shutout innings in relief.

Baltimore starter Cole Irvin lasted four innings, giving up six runs on five hits and four walks.

More must-reads:

TODAY'S BEST
The time needs to be now for Connor McDavid, Oilers to win Stanley Cup
Watch: Austin Cindric wins at Gateway after Ryan Blaney runs out of fuel on final lap
White Sox's Tommy Pham voices frustrations in profane interview
Eye-popping stat highlights Iga Swiatek's dominance in fourth round of French Open
Luka Doncic calls Mavericks' jump from NBA Draft Lottery to 2024 NBA Finals 'insane'
Yankees' Aaron Boone reveals rehab assignment date for ace pitcher
WNBA upgrades hard foul on Caitlin Clark to a Flagrant 1
Steelers could ‘get a little weird’ with usage of Justin Fields, says insider
Dustin Poirier teases retirement following his loss to Islam Makhachev at UFC 302
Watch: Robert MacIntyre claims emotional first PGA Tour win with dad as caddy
11 NFL teams gain cap space from post-June 1 cuts
Watch: Shuttered college's baseball team's magical run ends on walk-off HR
Commanders release kicker Brandon McManus following his lawsuit
Giants ace Blake Snell's season just went from bad to worse on Sunday
Yuka Saso rallies to win her second U.S. Women's Open
Ryan Blaney's misfortune is Austin Cindric's gain after wild final lap at Gateway
Tigers to promote outfielder with stellar batting eye
Report: NFL expected to reach resolution on Eagles', Falcons' tampering cases this week
Blue Jays GM has no interest in entertaining trade offers for star players
Watch: Orioles slugger Gunnar Henderson clobbers 19th homer vs. Rays