KANSAS CITY, Mo. (AP) -- Gil Meche's worst throw was to second base, but it didn't prevent him from picking up a victory.
Meche lost his shutout in the sixth when Fred Lewis and Ray Durham led off with singles. Randy Winn hit a comebacker, but Meche's throwing error to second allowed Lewis to score and Durham to take third, and Bengie Molina followed with a sacrifice fly that made it 3-2.
"That was a freak play," Meche said. "I turned to go to second. Unfortunately, my foot accidentally hit the rubber and kind of knocked me off a little bit. I should have made the play. You would hate for something like that to happen and we end up losing because of a stupid mistake. Fortunately, it didn't cost us."
Guillen, who is fourth in the American League with 57 RBIs, connected in the seventh off reliever Billy Sadler. It was his 12th homer of the year and 39th extra-base hit.
Molina added a sacrifice fly in the eighth to make it 5-3, but Royals closer Joakim Soria worked a perfect ninth, striking out two, for his 19th save in 20 chances.
Meche (5-8), who struck out the first five Giants, was pulled after 101 pitches in 5 2/3 innings. He allowed two runs, one earned, on three hits and two walks while striking out seven. In his past two starts, Meche has given up four earned runs and seven hits while striking out 17 in 13 innings.
"After the fourth, I looked up and saw 70 pitches when I sat down," Meche said. "Strikeouts are good, but that's the downfall of it."
Meche's high pitch count and the throwing error forced him out of game.
"We were striking out a lot and that was running up the pitch count," Giants manager Bruce Bochy said. "It looked like we were going into a rope-a-dope theory there. That's a credit to how well he was throwing. The guys were patient, but they pitched well."
Rookie shortstop Mike Aviles, who had three of the Royals' seven hits to raise his average to .339, hit a two-run single with two outs and the bases loaded in the fourth, scoring Ross Gload and Joey Gathright to make it 3-0.
"I don't go up there trying to impress anybody," Aviles said. "I just go up there trying to play the game the right way and play hard and hopefully everything works out for the best.
"Sometimes you have a short window of opportunity. Sometimes people don't get an opportunity. I'm just fortunate enough to get a little opportunity right now and I am trying to make the most of my time."
Meche did not allow a hit until Rich Aurilia's line drive single to center with one out in the fifth. Meche retired the first 10 batters he faced before walking Durham and Molina in the fourth, but struck out Aaron Rowand to end the inning.
"Gil's got good stuff and it's tough to see," Rowand said, referring to shadows across the field. "That combination is never good as a hitter. He's a good pitcher. There's no doubt about that. He threw the ball good and we didn't get enough hits."
The Royals loaded the bases with one out in the first off Kevin Correia (1-5), but scored only one run. Mark Grudzielanek's fielder's choice brought home David DeJesus, who had led off the inning with a walk.
Correia was making just his second start since missing six weeks with a left intercostal strain. He worked five innings and allowed three runs on six hits, with four walks and two strikeouts.
After retiring the first two batters in the fourth, Correia faced five more batters and allowed two runs on Aviles' hit.
"I seem to be one pitch away and I didn't execute. It cost me two runs," Correia said. "I had two outs and nobody on with strike one to the next guy and somehow I managed to throw another 20-plus pitches and give up two runs. That inning should have been quick and it should have been easy. It should have set me up for a couple more innings, and a chance for a win."
Lewis extended his hitting streak to a career-high 11 games. ... Jose Castillo made his first start of the season at second base. Durham, who normally plays second, was nursing a sprained ankle and was the DH. ... Royals 3B Alex Gordon walked three times, matching his career high. He also drew three walks on April 26, 2007, at Minnesota.