KANSAS CITY, Mo. (AP) -- Ernesto Frieri needed just four pitches to ruin a spectacular start by Zack Greinke, giving up two home runs in the ninth inning as the Kansas City Royals rallied to hand the playoff-contending Los Angeles Angels a stunning 3-2 loss on Saturday night.
Frieri (3-1) replaced Greinke with one out in the ninth after Alex Gordon singled. Billy Butler homered to center on Frieri's first pitch to tie the score. Three pitches later, Salvador Perez homered off the left-field pole for his first career walkoff homer.
The Angels entered the day 2 games back of Baltimore and New York for the second wild-card spot in the AL
Greinke gave up just five singles, walked two and struck out three in 8 1-3 innings. He has allowed seven runs and 24 hits in 37 innings for a 1.70 ERA in his past five starts.
Kendrys Morales, who homered for the second straight game, hit an 0-1 pitch from Jeremy Guthrie to right leading off the Angels' fifth for the first run.
Guthrie, who was 4-0 with a 1.70 ERA in his previous seven starts, faced the minimum number of batters the first four innings. He gave up a fourth inning leadoff single to Mike Trout, but picked him off first. Guthrie left after eight innings, allowing two runs on five hits. Kelvin Herrera (3-3) replaced Guthrie and picked up the win with a scoreless ninth.
Greinke, who was acquired from Milwaukee in a trade on July 27 trade and won the 2009 American League Cy Young Award while with Kansas City, pitched out of a first inning jam.
Alcides Escobar, who had two of the hits off Greinke, singled with one out to extend his hitting streak to a career-high 11 games. Escobar advanced to third on Gordon's groundball single to right.
Escobar was out at the plate when he attempted to score on Butler's grounder to third baseman Alberto Callaspo. Perez's grounder to Callaspo ended the inning and threat.
After Escobar's third inning single, Greinke did not allow another hit until Jeff Francoeur's eighth inning single.
The Angels added a run in the eighth, when Vernon Wells led off with a single and advanced to third on two groundball outs. After Trout walked, Torii Hunter laced a run-scoring single to right that Francoeur apparently lost in the lights as it glanced off the heel of his glove. Hunter leads the American League with a .349 average since the All-Star break and has 16 RBIs in his past 17 games.
NOTES: RHP Ervin Santana might be pushed back a few days in the Angels rotation after being struck in the arm by Josh Donaldson's liner in Wednesday's start against Oakland. "Ervin just got smoked on the forearm," Angels manager Mike Scioscia said. "We might take a couple of days with him. Ervin's going to get the ball; he's going to pitch. It's set him back a little bit as to when he's going to throw his pen. He'll throw a couple of light things. He'll probably throw this weekend and then we'll see where he is." . Royals 2B Johnny Giavotella committed two errors. The Royals had committed just five errors in their previous 18 games. .This series closes Sunday with the Royals starting rookie LHP Will Smith, who pitched seven scoreless innings Tuesday in a victory at Minnesota. RHP Dan Haren will start for the Angels.