OAKLAND -- The A's responded to Kansas City's five-run, eighth-inning rally with six runs in the bottom half of the frame, getting a bases-clearing double from Matt Joyce in an eventful 10-8 victory at the Coliseum on Tuesday night, preventing the Royals from claiming sole possession of the second American

OAKLAND -- The A's responded to Kansas City's five-run, eighth-inning rally with six runs in the bottom half of the frame, getting a bases-clearing double from Matt Joyce in an eventful 10-8 victory at the Coliseum on Tuesday night, preventing the Royals from claiming sole possession of the second American League Wild Card spot.

Facing a one-run deficit, Kansas City got home runs from Andrew Butera , Eric Hosmer and Mike Moustakas against Oakland's bullpen in the eighth, before the A's responded with four consecutive hits against Royals reliever Joakim Soria to open the bottom portion, including RBI singles from Ryon Healy and Matt Olson . Then, with two outs, Mike Minor yielded Joyce's three-run double and a run-scoring single to Marcus Semien that capped a wild inning.

"Momentum obviously went from us to them pretty significantly, and then you get a couple guys on base again and now you have a pretty good feeling," A's manager Bob Melvin said. "That's really what the culture we want to set with these guys is -- we're going to come back, no matter what. We're going to fight. If we go down, we're going to go down bleeding."

The Royals remain a half-game back of the Angels in a tightly contested Wild Card race following the disheartening loss. Hosmer had four RBIs -- including two on a double in the first inning against right-hander Chris Smith, who was in line to pick up his first career win as a starter before the bullpen's late-inning meltdown. Smith rebounded from a three-run opening frame to get through 5 1/3 innings.

The A's got home runs from Khris Davis , Joyce and Olson against Royals starter Jason Hammel , who allowed four runs and eight hits in six innings opposite his former team, striking out six and walking one.

"We did a great job," Royals manager Ned Yost said. "Drew battling back with the two-run homer to give us the lead. Then Hos with the monster shot to left, and then Moose with his 35th. Going into the eighth, you feel pretty good with a four-run lead and a rested 'pen. We just couldn't contain them."

MOMENTS THAT MATTERED

Walk this way: The Royals were still clinging to an 8-6 lead when Minor struck out Chad Pinder for the second out of the eighth inning. That's when they opted to intentionally walk pinch-hitter Rajai Davis to set up a left-on-left matchup between Minor and Joyce, who drove the first pitch he saw into center field for a go-ahead double. More >

"I kind of saw the cards unfolding and came up with a good approach," Joyce said. "Minor has good numbers against lefties, so for me, I kind of expected the intentional walk. I'm looking something middle away, something I can drive, and fortunately I stayed in the zone with the first pitch he threw. I think, in situations like that, bases loaded, pitchers kind of have to come to the hitter, so for me that was a good pitch to hit."

"It's difficult to swallow," Minor said. "Trying to pick up your teammate, pick up your team and try to get out of the inning, and I can't. It's been pretty difficult, the last couple of outings for me. I feel like I've made pretty good pitches, and tonight was one of those nights where I felt like I made some good pitches and didn't have good results."

Treinen recovers: A's right-hander Blake Treinen , who was responsible for the homers to Hosmer and Moustakas in the eighth after Santiago Casilla allowed the go-ahead, two-run homer to Butera, returned for the ninth hoping to avenge himself. Treinen yielded a leadoff single to Alcides Escobar , before settling down to retire each of his next three batters, two via strikeout, to lock down the victory.

"You have the emotional roller coaster that you go through in a short period of time, from being out on the mound to the dugout to having to go back out there and get the intensity up," Melvin said. "That's not easy to do. Then the first guy gets a little nubber hit and now they're one swing away from tying it again. He battled nicely."

REPLAY REVIEW

The A's challenged an out ruling in the sixth inning after Matt Chapman attempted to steal third base. After a review the call stood.

WHAT'S NEXT

Royals: Left-hander Danny Duffy (7-9, 3.68 ERA), who is winless in August, will look to end a two-game losing streak at 2:35 p.m. CT Wednesday. He allowed seven runs (three earned) to the Mariners Aug. 6 and five runs to the White Sox on Aug. 11.

A's: The A's will close out a lengthy nine-game homestand with a 12:35 p.m. PT matchup with the Royals on Wednesday afternoon. Right-hander Paul Blackburn (3-1, 3.02 ERA), who has tossed more than five innings in each of his eight career starts, will be on the mound for Oakland.

Watch every out-of-market regular-season game live on MLB.TV.