SAN DIEGO -- Mat Latos didn't have his best stuff on the mound or on the basepaths, yet still won for the first time in four starts.
Latos (5-8) allowed three runs on seven hits in six innings, with two walks, to win for the first time since June 5 against Houston.
"Not as sharp as we've seen him the last five outings or so," Padres manager Bud Black said. "He was a little bit under the weather today but battled through it."
Heath Bell pitched the ninth for his 21st save in 22 chances, getting the final out after allowing consecutive two-out singles.
Latos helped himself in the bottom of the third when he hit a leadoff double and advanced to third on Chris Denorfia's flyout. Latos hesitated on Jason Bartlett's grounder that shortstop Alcides Escobar made a diving play on. Latos did score on a wild pitch for a 3-1 lead.
"I felt bad," Latos said. "I don't spend much time on the bases and I froze. Bartlett hit that ball up the middle and my first instinct was to go, and then I thought the pitcher was going to get it and then I froze. I felt real bad. That's an RBI for him.
"I jokingly thought to myself, if I have to steal home, I'm going to steal it because I felt bad for letting that opportunity come about."
"That was a good relay from the guys," Pena said. "I was just trying to do my job and protect home plate the best way possible."
Left fielder Alex Gordon got his 13th assist of the season on the play. The Royals have thrown out 16 runners at the plate, including four in the last five games.
The Padres, coming off consecutive series victories against Boston and Atlanta, have won five of six. The Royals have lost seven of nine.
The Padres continued their domination of Jeff Francis (3-9), who allowed four runs, three earned, and five hits in five innings.
Francis dropped to 5-13 with a 5.65 ERA in 22 career starts against San Diego. The former Colorado Rockies pitcher is winless in his last six starts against San Diego. At Petco Park, he's 3-7 with a 5.27 ERA in 12 starts.
Overall, Francis has lost three straight starts and four of five.
With Headley aboard on a double, Ludwick homered to left with two outs in the first, his 10th.
"It was just a bad pitch that I left up," Francis said. "He hit it hard. It takes a lot to hit the ball out of this ballpark."
Kansas City's Eric Hosmer hit a sacrifice fly in the third.
The Padres took a 4-1 lead in the fourth when Jesus Guzman reached on a throwing error by Escobar and eventually scored on a throwing error by first baseman Hosmer, who was trying to throw him out at third after Orlando Hudson's groundout.
The Royals pulled to 4-3 with one out in the sixth on Pena's two-run double down the right-field line to score Gordon and Jeff Francoeur, who opened the inning with singles. Pena took third on Escobar's fly to right but was stranded when second baseman Hudson made a nice play to throw out pinch-hitter Billy Butler and end the inning.
Gordon extended his hitting streak to 14 games.
Francis is 1-5 with a 6.75 ERA in eight road starts. ... Padres C Nick Hundley had his right elbow drained and received a cortisone shot two days after the joint started swelling during a game. An MRI showed no structural damage. Hundley said the doctors told him he had an irritated tendon. He hopes to return Wednesday. ... Manager Ned Yost said the Royals plan to go with a six-man rotation at least until the All-Star break. Kyle Davies is ready to come off the disabled list and rookie Danny Duffy is pitching well enough that the Royals don't want to send him down to the minors.