KANSAS CITY, Mo. (AP) -- Justin Maxwell hit a grand slam with two outs in the 10th inning and the Kansas City Royals beat the Texas Rangers 4-0 Sunday in a matchup of AL wild-card contenders.
The Oakland Athletics clinched the AL West with the Rangers' loss.
Texas dropped 1 1/2 games behind Cleveland for the second wild-card spot. Kansas City is 3 1/2 back.
Maxwell connected off former Royals All-Star closer Joakim Soria.
Royals starter James Shields gave up six hits in eight innings, walking one and striking out two.
Texas starter Alexi Ogando pitched two-hit ball for seven innings, striking out five and walking one.
Eric Hosmer led off the Royals 10th by punching a double with two strikes down the left-field line off Neal Cotts (5-3). Soria relieved and intentionally walked Billy Butler, and an infield single by Salvador Perez loaded the bases.
Mike Moustakas popped up and pinch-hitter George Kottaras grounded into a force play at the plate before Maxwell hit a full-count pitch over the left-field wall for his second career grand slam.
Tim Collins (3-6) worked a perfect 10th to pick up the victory.
Ogando, who had three stints on the disabled list this season, excelled in just his eighth start since May 15. He left after 77 pitches.
Maxwell hit a leadoff single in the third and moved up on a sacrifice, making him the lone Royals runner to get past first base.
Shields, who was 4-1 in his previous five starts, lowered his ERA to 3.21. He was struck in the right elbow by Donnie Murphy's liner in the second, but remained in the game after making some warmup tosses as manager Ned Yost watched from the mound.
Shields allowed two-out singles to Ian Kinsler and Elvis Andrus before getting out of the inning.
Royals closer Greg Holland took over in the ninth. Alex Rios made it to first when he struck out on a wild pitch to lead off the inning and stole second. But Rios was thrown out trying to take third on Adrian Beltre's fly to left, with Alex Gordon getting his AL-leading 16th outfield assist.
Perez helped out Shields by throwing would-be basestealers Elvis Andrus at third base in the first and Leonys Martin at second in the fifth. It was the second time this season Perez has thrown out two runners in a game.
NOTES: The Royals' final home attendance was 1,750,754, an average of 21,614 for 81 games. The Royals averaged 21,748 for 80 home dates last year. ... The Rangers play their final seven games at home. LHP Derek Holland, who starts Monday against Houston, has lost five straight decisions at Rangers Ballpark since May 31. He is winless in his past eight starts, the longest drought of his career. ... The Royals, who finish up with seven games at Seattle and Chicago, are 38-36 on the road. They have not finished above .500 on the road since going 43-39 in 2003.