SAN DIEGO (AP) -- The last time Clayton Richard won at Petco Park, the San Diego Padres had a winning record and appeared chugging toward a division title.
Yes, it had been that long.
Richard won for the first time in 12 home starts since August and the Padres beat the Kansas City Royals 4-2 on Tuesday night for their third straight series win.
The Padres have won six of seven, including series wins against Boston and Atlanta. Still, they are 36-45 and tied for last in the NL West with the Los Angeles Dodgers .
The Padres clinched their first winning homestand of the year, winning four of five with one game to go.
Jeff Francoeur homered and threw out a runner at home for the Royals, who have lost two straight and eight of 10.
Richard (4-9) hadn't won at Petco Park since beating Arizona on Aug. 24, two days before a 10-game losing streak helped doom the Padres' run at the NL West title. The Padres had lost his 11 home starts since Aug. 29, tied for the longest such stretch in club history. The left-hander was 0-8 in those 11 starts.
"Baseball's a funny game that way. Sometimes it doesn't always make sense, but that's how it works," Richard said.
Including Tuesday night's game, Richard's ERA in his last 12 home starts is 2.76. He held the Royals to two runs and five hits in seven innings, struck out five and walked one.
"Well-deserved," manager Bud Black said. "He's pitched well. You look at his homework - look at the ERA, the hits per inning pitched. The wins are going to come if he continues to pitch like that."
Heath Bell pitched the ninth for his 22nd save in 23 chances.
"He's competed hard all year," Cameron Maybin said of Richard. "Whenever we have him out there, we're confident he's going to keep guys off-balance. He did another great job tonight."
Maybin had three hits and scored twice for the Padres, who gave Richard some early run support.
Ryan Ludwick hit an RBI single in the first inning. The Royals tied it in the second when Matt Treanor singled in Francoeur, who had walked and stolen second. Earlier in his at-bat, a foul ball bounced up and hit Treanor in the face.
Maybin beat out a high chopper leading off the second and scored on Kyle Phillips ' double to the gap in left-center. Richard sacrificed and Phillips scored on Will Venable 's sacrifice fly for a 3-1 lead.
Francoeur threw out rookie Anthony Rizzo trying to score from second on Orlando Hudson 's single to end the third. It was the 17th outfield assist at the plate for the Royals this season and their fifth in the last six games. Overall they have 31 outfield assists, tops in the majors.
They also had an error that allowed the Padres to pad their lead. Maybin singled leading off the fourth and stole second. He bluffed on Phillips' fly out to left, and Alex Gordon 's high throw glanced off third baseman Wilson Betemit 's glove, went between the legs of pitcher Felipe Paulino backing up the play and into the Royals' dugout, allowing Maybin to score.
Francoeur homered off Richard in the seventh, his 11th.
"We couldn't get much going with him," Royals manager Ned Yost said of Richard. "He worked quick and threw strikes. He threw a lot of cutters in on our hands that we couldn't handle."
Paulino (0-2) allowed four runs, three earned, and 11 hits in seven innings, struck out seven and walked one.
Paulino ran his winless streak to 33 appearances, including 10 starts.
"I feel great," Paulino said. "I've been working so hard. I'm here to compete and the manager knows that."
NOTES: Padres minor-league OF Donavan Tate has been suspended 50 games following his second positive drug test. He will be given credit for 25 games already served while undergoing counseling for substance abuse. The rest of the suspension begins immediately. The 20-year-old Tate was the third overall pick in the 2009 draft. ... The Royals are 0-5 at Petco Park, including 0-3 in 2004, the only active park in which they don't have a win.