Updated

St. Louis, MO (SportsNetwork.com) - Eric Hosmer drove in the go-ahead run in the ninth inning to complete the Kansas City Royals' 8-7 comeback victory over the St. Louis Cardinals at Busch Stadium.

The Royals faced a 4-0 deficit early on and trailed 7-6 before Alcides Escobar tied things with a RBI single in the eighth.

Hosmer followed Omar Infante's one-out double in the ninth with a single to left field off Trevor Rosenthal (0-3), and Infante beat Matt Holliday's off- target throw to the plate.

Wade Davis (5-1) recorded his 13th straight scoreless appearance in the eighth to pick up the victory, Kansas City's fourth in its last six games, and Greg Holland posted his 16th save with a flawless ninth.

Alex Gordon belted a three-run homer to highlight a 13-hit attack for the Royals, who finished an efficient 6-for-11 with runners in scoring position.

"We grinded our way to a win," Royals manager Ned Yost said. "It was a tough one."

St. Louis went 2-7 on a disappointing homestand despite receiving a grand slam by Kolten Wong and a solo homer from Peter Bourjos.

Kansas City's bullpen limited the hosts to one hit after James Shields labored through his shortest outing of the season, having allowed seven runs -- five earned -- over 5 1/3 innings.

The Cardinals wasted a bases-loaded opportunity in the first inning when Yadier Molina bounced into a double play, but they loaded the bags again in the second for Wong, who turned on a middle-in offering and sent it over the wall in right field for his first career home run.

"It came at a great time," Cards manager Mike Matheny said. "We needed that. It was a great spark."

The slam snapped a string of 20 consecutive scoreless innings for St. Louis, but the Royals jumped ahead with a six-spot off Jamie Garcia in the fifth.

Escobar tripled in Mike Moustakas and scored when Shields one-hopped the wall in left for a double. Shields raced home as Norichika Aoki slapped a base hit down the third-base line, and after Garcia plunked Hosmer on a 2-2 pitch with two away, Gordon found the right-field seats for a go-ahead three-run blast.

St. Louis answered with two runs in the bottom half, thanks in part to a Moustakas error that put runners on first and second with no outs. An Oscar Taveras sacrifice fly made it 6-5, and Jhonny Peralta tied things with a two- out, run-scoring single.

Bourjos, who was part of a double-switch in the top half, took Shields over the left-field wall to lead off the sixth, but again Kansas City responded.

With two outs and runners on first and second in the eighth, Escobar flared a bloop base hit into short center off Pat Neshek to knock in Salvador Perez.

Game Notes

Wong only had seven extra-base hits in 182 career at-bats prior to his grand slam ... Shields has allowed seven homers in his last three starts after serving up five total in his first 10. His ERA has risen over a full run over his last three outings from 2.67 to 3.68 ... Garcia was charged with six runs on eight hits over five innings ... Royals reliever Wilking Rodriguez tossed a 1-2-3 seventh in his big league debut ... Kansas City will host the final two games of this home-and-home I-70 series beginning on Wednesday.