The White Sox had won 10 of 13, but saw their lead over Detroit in the AL Central shrink to a half game when the Tigers beat the New York Yankees 6-5 earlier in the night.
Gordon Beckham hit his first career leadoff homer for Chicago, and the White Sox scored again in the sixth after Kansas City tied it in the top half. But RBI singles by Tony Abreu and Alex Gordon off Peavy (9-8) in the seventh gave Kansas City a 3-2 lead.
The left-hander gave up two runs and seven hits in 6 2/3 innings and finally came out on top after going 0-3 in his previous seven starts. It was a big improvement over his previous outing, when he got knocked out in the third against Cleveland after being staked to a six-run lead.
He and manager Ned Yost had a long talk about being aggressive following that game, which the Royals eventually won. The message? Go after the hitters, establish the fastball.
"His last three or four starts, he comes out and he hasn't established his fastball," Yost said. "All he's doing is throwing 82, 83, trying to get his control down, but he's got nothing to speed the bats up so they sit soft."
It was different against the White Sox.
Even when Beckham connected an 87 mph pitch in the first, Yost didn't blink because the home run came on a fastball. Chen was following the plan.
"Obviously, I'm trying to establish my fastball," he said. "I'm trying to keep the ball down, but also pitching in and cutting the ball in on the righties was a big plus for me."
The way Peavy was pitching, the Royals needed that. And the bullpen did its job with Kelvin Herrera pitching 1 1/3 innings and Greg Holland retiring the side in the ninth for his second save in four chances.
Peavy also gave up seven hits in 6 2/3 innings, but was a tough-luck loser after beating Minnesota in his previous two starts. He found his control after walking the game's first two batters, issuing just one the rest of the way, but he couldn't protect the lead after the White Sox went up 2-1.
"I don't like to lose," he said. "I just hate to lose. I wish I could have done more to help us win, I really do. It stinks when you feel like you have a chance to win and you don't. You get so close and you could have done things differently to win."
The Royals had runners on first and third with one out in the seventh after Jeff Francoeur reached on a bunt down the third-base line and Eric Hosmer singled. Abreu then tied it with a single to left, and although Hosmer got thrown out at third by Dayan Viciedo, the Royals weren't finished.
Jarrod Dyson just beat out a single to second after Beckham made a diving stop on his grounder, and Gordon then chased Peavy with a single to center that made it 3-2, putting Kansas City up for good.
Now, the Royals are 4-3 in August after dropping 19 of 26 in July.
"I think the last couple days we've had renewed energy, renewed vision, and I'm pleased with where we're at right now," Yost said.
The only other White Sox player with a leadoff homer this season was Alejandro De Aza against Cleveland on April 9. ... The White Sox scratched Kevin Youkilis from their lineup because of a sore right knee. Youkilis was penciled in to bat second and play third base. Instead, the White Sox inserted Ray Olmedo into the lineup at third and had him bat ninth while juggling several other spots in the order. ... Jordan Danks got his second straight start in center field with De Aza bothered by tightness in his back. "I just want to get better," De Aza said. "I'd rather lose two or three days instead of trying to play and it gets worse." ... Jeremy Guthrie goes for his first win as a Royal, while Jose Quintana starts for the White Sox on Wednesday. Guthrie is 0-3 with the Royals after going 3-9 with a 6.35 ERA in 15 starts and 19 appearances for Colorado. Quintana has four no-decisions since the All-Star break.