Manny Machado hit a dramatic two-run homer in the seventh inning to put the Orioles up 4-2, but Josh Donaldson would end the game with a three-run homer to give Oakland the 5-4 victory.

Jaso Gets First - John Jaso put the A's up 1-0 in the third with an RBI single.

Double Trouble - The Orioles made their first threat of the night in the fifth inning against Jeff Samardzija with two on and nobody out before Caleb Joseph bounced into a double play.

Redemption - With J.J. Hardy at third following the double play ball, Jonathan Schoop came to bat and put the Orioles up 2-1 with his 10th homer of the season.

All Tied Up - In the bottom of the fifth inning, Derek Norris connected for his ninth homer to make it a 2-2 game.

Silencer - Manny Machado heard boos all night long from the Athletics fans after his altercation with the team in Baltimore. Machado, silenced the crowd for a moment in the seventh inning with his 10th homer put the Orioles up 4-2.

Quality Tillman - Chris Tillman gave the Orioles 6 2/3 innings Friday night, allowing just two runs on four hits while striking out six.

Four Big Outs - Tommy Hunter did not allow a hit during his 1 1/3 innings of work on Friday night to get the game to Zach Britton in the ninth.

In The End - Josh Donaldson hit a walk-off three-run homer in the bottom of the ninth to give Oakland th 5-4 victory.

Next WBAL Broadcast - The Orioles play game two of their series with the Athletics on Saturday evening. First pitch is set for 9:05pm, with Joe Angel and Fred Manfra starting the broadcast at 8:35pm.

Follow me on Twitter: @cdwill77

OAKLAND, Calif. (AP) -- Josh Donaldson swiped the spotlight from Manny Machado in the biggest way he could.

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 center field on a sinker from 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 the All-Star third baseman's 21th homer of the season, fifth career game-ending hit, and third career game-ending homer - including the second this season.

But this one was even sweeter for Donaldson and the A's because it took the attention away from Machado, who hit a go-ahead two-run homer in the seventh after creating an even bigger stir with his bat 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.

In the opener of that series, 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 Friday's game he has moved on from the incident. Melvin also said nobody on his club had even talked about it since.

''When you see J.D. come up in the ninth, you kind of have that feeling, 'Really? Could this happen?''' Melvin said. ''And it did.''

Oakland Athletics' Jeff Samardzija works against the Baltimore Orioles in the first inning of a …

Donaldson said he sympathized with the boos Machado endured from A's fans during pregame introductions, when he ran to his spot at third base and every time he was announced at the plate. But he said he tried ''not to get caught up in all that jazz'' and instead focus on the task at hand.

''I enjoy those moments,'' he said. ''It's one of those things where you've got to try to relish the opportunity, and anytime I can step up to the plate with an at-bat to help our team win the game or win the game right there, I feel better about it.''

Machado quieted the hoots and hollers with his 10th homer of the season in the seventh to put the Orioles ahead 4-2. 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.

''The booing is part of the game and I have to get used to it,'' Machado said. ''You have to be able to block it out. You just try and channel your energy to do well. I have to gain everyone's respect back from everyone that I let down.''

Baltimore Orioles' Chris Tillman works against the Oakland Athletics in the first inning of a ba …

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 as Oakland (60-36) extended the majors' best record.

It was just the type of victory that showed why the two-time defending AL West champion A's have major expectations, especially 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.

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 against Chris Tillman the first 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 and gave the A's another memorable victory in a season already full of them.

NOTES: Cespedes, the two-time reigning Home Run Derby champion, snapped an 0-for-19 skid - the longest hitless streak of his career - with two singles. ... Orioles RHP Ubaldo Jimenez, on the disabled list since July 11 with a sprained right ankle, is scheduled to throw a bullpen session Sunday and could make a rehabilitation start in the minors in the middle of next week. ... RHP Jason Hammel (0-1, 3.60 ERA) starts for the A's opposite Orioles lefty Wei-Yin Chen (9-3, 4.15 ERA) on Saturday.