San Diego knew it had to beat Arizona to maintain its NL West lead over Los Angeles, and the Padres responded by routing the Diamondbacks 12-4 to maintain a one-game margin over their rivals, who beat Colorado 19-11.
"We knew we had to get going," said Jake Peavy (11-14), who won his third straight decision. "When the Dodgers win, you know coming in here we had to play good baseball."
San Diego's victory was all the more satisfying because it came one night after the Padres blew a late lead and lost at St. Louis.
"Many times we've talked about it -- it's how you handle it," manager Bruce Bochy said. "We came out focused and played well after a tough loss. That's the only way you're going to have a winning season is if you things like that, because you're going to have to deal with tough losses and gut-wrenching losses."
San Diego closes with three more games at Arizona while the Dodgers finish with a three-game series at San Francisco.
Thursday night's victory gave the Padres at least a tie for the wild card with Philadelphia, which lost at Washington. But the Padres are aiming for their second consecutive division title.
"The players just realize that we're the best team in the division," outfielder Dave Roberts said. "We're going to win this division. We know it. We expect it. We expected that all year long, so if you lose one, you've got to go and get them tomorrow."
Peavy allowed two runs and five hits in six innings, struck out seven and walked four. He leads the league with 215 strikeouts.
"My job is very easy when the boys go out and do what they did tonight," Peavy said.
Miguel Batista (11-8) gave up seven runs and eight hits in 3 2/3 innings -- his shortest outing of the season. It may also have been Batista's final start for the Diamondbacks, who have not said whether they will try to re-sign the 35-year-old right-hander.
San Diego took a 4-0 lead in the second when Batista walked Geoff Blum with the bases loaded, Josh Barfield hit into a run-scoring forceout and Roberts had a two-run single, Mike Cameron added an RBI single in the third, and Giles hit a two-run homer in the fourth.
After Arizona closed to 7-2 in the fourth, Branyan homered off Greg Aquino leading off the fifth -- his sixth homer in 22 games since San Diego acquired him from Tampa Bay Aug. 24.
Peavy entered 6-8 with a 5.65 ERA against the Diamondbacks, going 0-2 this year. After hitting leadoff man Craig Counsell and walking Orlando Hudson, Peavy retired eight of his next nine batters. He gave up run-scoring singles to Conor Jackson and Miguel Montero in the fourth.
"Early on, his velocity was down a little bit," Arizona manager Bob Melvin said. "It looked like it picked up as the game was going on."
- San Diego improved to 23-50 at Arizona.
- Batista will sign copies of his first novel, "The Avenger of Blood," on Friday at the ballpark.
- Arizona Cardinal running back Edgerrin James attended the game as a guest of general partner Jeff Moorad.
- Arizona INF Robby Hammock doubled in his first major league at-bat since Oct. 3, 2004.
- Roberts stole his 48th base, extending his career high.