Updated

Justin Maxwell clubbed a grand slam in the bottom of the 10th inning to lift the Kansas City Royals to a 4-0 win over the Texas Rangers in rubber match of a three-game set at Kauffman Stadium.

The Royals' 10th began with a double by Eric Hosmer off Neal Cotts (5-3), the first Kansas City hit since the third inning. After Joakim Soria intentionally walked Billy Butler, Salvador Perez singled to load the bases with no outs.

Soria nearly got the game to the 11th, retiring Mike Moustakas on a foul pop up and getting a force out at home on George Kottaras' grounder. Maxwell, however, worked the count full before launching a pitch to left field for the walk-off blast.

"I was just trying to hit the ball hard," Maxwell said. "The guys in front of me had great at-bats and in that situation it was kind of tough to see with the shadow there so I was trying to get ready early."

The loss dropped the Rangers to 1 1/2 games behind Cleveland for the second AL wild-card spot. The Royals are two games behind Texas.

James Shields tossed eight innings for the Royals, allowing six hits and walking one. Tim Collins (3-6) pitched a flawless 10th to get the win.

Texas starter Alexi Ogando held Kansas City to a pair of singles in seven stellar innings.

"They are all painful losses now," Texas shortstop Elvis Andrus said. "Their guy and Ogando pitched amazingly, but whether we lose by one or lose by four, every loss is going to be painful from here on out."

The Royals finish the season with three games at Seattle and four against the White Sox in Chicago, while Texas will return home for three games against Houston and four against the Angels.

Game Notes

Maxwell's walk-off grand slam was the first for a Royal since Joe Randa in 2001 and his second. He also hit a game-ending slam in 2009 while playing for Washington ... The Royals wrapped up the home portion of their schedule with a 44-37 record. The 44 wins are the most since 1992 ... Texas finished with a 45-36 mark on the road.