Oakland, California: Josh Donaldson hit a three-run homer in the bottom of the ninth inning, sending the Oakland Athletics to a stunning 5-4 comeback victory over the Baltimore Orioles on Friday night.

Donaldson’s drive over the wall in centre off Zach Britton (3-2) sent the A’s streaming out of the dugout in front of an announced crowd of 27,232 at the Coliseum. It was Donaldson’s fifth career game-ending hit and third career game-ending homer.

The much-booed Manny Machado had lined a go-ahead, two-run homer in the seventh, and Jonathan Schoop hit a two-run homer in the fifth that appeared to be enough for the AL East-leading Orioles. But beating the best team in baseball — especially at home — has never been easy this season.

Eric O’Flaherty (1-0) tossed one scoreless inning for the win, Oakland’s major league-leading 60th of the season (60-36).

The two-time defending AL West champion A’s held baseball’s best record at the All-Star break and have major expectations after acquiring pitchers Jeff Samardzija and Jason Hammel from the Chicago Cubs on July 4.

Samardzija looked ready to lose his second straight solid start for Oakland. He gave up six hits — including the two homers — in seven innings.

But the A’s rallied for him the way they always seem to do at home.

The victory was even sweeter for the A’s because it swiped the spotlight from Machado, who created a stir with his bat another way the last time he faced Oakland.

Machado threw his bat near Donaldson at third base during a plate appearance in Oakland’s win at Baltimore last month after reliever Fernando Abad threw consecutive high-and-inside pitches.

Machado was suspended five games and was fined an undisclosed amount. Abad was fined but not suspended.

The bat-throwing incident was an extension of a feud that began in the series opener between the teams in Baltimore. Machado yelled in Donaldson’s face after the third baseman tagged him on the chest, knocking Machado off his feet. The dugouts cleared briefly.

Machado, who also singled in the fifth, said before the game he has moved on from the incident. A’s manager Bob Melvin said nobody on his club had even talked about it since.

But fans in Oakland still let their voices be heard. Most in the crowd jeered Machado during pregame introductions, when he ran to his spot at third base, and every time he was announced at the plate.

He quieted the hoots and hollers with his 10th homer of the season. A fan threw the ball back on the field, and others stood and booed as he rounded the bases.

Machado high-fived teammates back in the dugout.

John Jaso’s RBI double in the third gave Oakland a 1-0 lead, and Derek Norris’ ninth homer in the fifth tied it 2-2. That was all the A’s could muster out of Chris Tillman, who allowed two runs and four hits in 6 2-3 innings.

Baltimore had retired 10 straight batters until Yoenis Cespedes singled leading off the ninth. Brandon Moss followed with another single before Donaldson’s homer handed Britton his third blown save in 18 opportunities this season.