SAN FRANCISCO — Mat Latos hardly considered it a bad day even if he watched two home runs by Carlos Beltran sail over the right-field wall.
The way Latos started this season, small strides are noteworthy.
Beltran connected twice to give him 300 career homers, helping Tim Lincecum end a three-start winless stretch in the San Francisco Giants' 3-1 win over Latos and the San Diego Padres on Wednesday to complete a rare sweep in this rivalry.
The 23-year-old Latos began the year on the disabled list and then lost his first five decisions.
"Things have come together from the total pitching fundamentals side," Padres manager Bud Black said. "He's throwing his off-speed pitches for strikes. He's commanding his fastball better. The walks are down, strikeouts are up. He's holding runners better. He's doing some things that equate to better outings. That's what we're seeing out there, that's what we are seeing out of Mat for the last three weeks or month."
Beltran homered in the first inning and again in the sixth with a splash hit into McCovey Cove to put the Giants ahead. It marked the slugger's 30th career multihomer game, third this year and first since joining San Francisco in a trade from the Mets on July 28.
"Beltran is one of the best players in the National League. And he's got that in him," Black said.
Lincecum (13-12) outdueled Latos (7-14) for his first win since beating the Padres on Aug. 24.
The defending World Series champion Giants began the day trailing the first-place Diamondbacks by 8½ games in the NL West. Arizona had a night game at Los Angeles.
San Francisco has its first four-game winning streak since July 9-15.
Lincecum allowed four hits and an unearned run while striking out six and walking two in seven innings as the Giants wrapped up their first winning home series in the last eight sets since taking two of three against Milwaukee from July 22-24. September call-up Hector Sanchez caught Lincecum for the first time.
"A lot of credit goes to Sanchez for making adjustments from our first inning on," Lincecum said.
After Dan Runzler walked pinch-hitter Chris Denorfia to start the eighth, Sergio Romo relieved and retired the side in order. He pumped his fist after striking out Cameron Maybin to end the inning. Santiago Casilla finished with a 1-2-3 ninth for his third save.
San Diego, which dropped its fourth straight this season at AT&T Park and sixth in seven games, was swept in a series of three or more games against the Giants for the first time since Aug. 22-24, 2008. This was San Francisco's first sweep this year since taking three in a row June 24-26 from Cleveland.
It was largely because of Beltran.
His shot into the water beyond the right-field arcade was the fourth by a Giants player this year, 59th by San Francisco overall and No. 83 in the history of the 12-year-old ballpark. Home run king Barry Bonds has 35 of them.
Beltran also homered over the elevated brick wall in right to tie the game in the first. He went 7 for 12 (.583) with a double, three homers and four RBIs in the series and is batting .520 (13 for 25) with four homers in seven games against San Diego this season.
"You really have to hit the ball good in order to hit it out," Beltran said. "That's why in the dugout we always talk about what Barry Bonds did here for many years."
The Padres took a 1-0 lead against Lincecum on Jesus Guzman's two-out RBI double in the first.
Latos, who nursed a shoulder injury in early April, was tagged for seven hits and three runs in seven innings. He struck out eight and walked one.
"I feel I pitched great," Latos said. "I think earlier in spring training I had that injury and I was battling through that. I began trusting it again. Just letting it go. And throwing everything for strikes. And that seems to be a big key to what I've been doing."
Pablo Sandoval provided a big defensive stop to end the third with Will Venable on third after he stole his 26th base. Sandoval lunged to his left to field Guzman's sharp grounder, then fired to first just in time while throwing from one knee. He chuckled after doing it again on nearly an identical play on Maybin's grounder in the sixth.
"Tough as he usually is," Maybin said of Lincecum. "That's why he's a Cy Young Award winner."
NOTES: San Diego is 4-17 in its stretch of 30 straight games against division foes. ... Longtime Padres broadcaster and former New York Yankees 2B Jerry Coleman celebrated his 87th birthday. A retired Marine Lt. Col. and Bay Area native, Coleman worked the radio booth from the fourth through the sixth innings. ... After an off day Thursday, RHP Tim Stauffer starts for the Padres on Friday, looking for his first career win against the Diamondbacks in his fifth start and 11th appearance.