Updated

There is so much Chase Headley does for the San Diego Padres. However, on Saturday night, it was a play that Headley didn't make that proved costly.

Joaquin Arias homered and drove in three runs, and the San Francisco Giants used another big inning with the help of Headley's defensive lapse to beat the San Diego Padres 8-7.

Arias hit a leadoff homer in the second and had an RBI single to cap a four-run fifth that put the Giants ahead 5-4. He blooped an RBI single in the seventh when San Francisco scored twice to take a 7-5 lead.

Pinch-hitter Ryan Theriot led off the fourth inning with a single and went to third on Angel Pagan's double. Marco Scutaro followed with a sacrifice fly. Pablo Sandoval then hit a grounder to Headley's left at third base.

As Headley fielded the ball, he had to make a 360-degree spin. Instead of going to first, the off-balanced Headley decided to throw home in an attempt to get Pagan. But the throw had little zip on it, and Pagan scored easily.

"Obviously, I wish I would have made the throw to first, now," Headley said. "I knew (Pagan) wasn't running on contact. ... I got a good break on it. I saw him still hanging around (third base). I fielded it, turned around and threw home. It was a little bit too late."

Had Headley taken the out at first base, the Giants wouldn't have scored the final two runs of the inning.

San Diego scored twice in the ninth inning off reliever Jeremy Affeldt on RBI singles from Alexi Amarista and Chris Denorfia to cut the lead to 8-7. That made Headley's decision in the fourth loom even larger.

"Looking back on it, I wish I would have made the play to first because it didn't work out," Headley said.

Posey followed with a double and Sandoval scored on Pence's sacrifice fly. Arias then singled in the final run.

Headley hit a three-run homer and Carlos Quentin added a solo shot. But the Padres dropped their fifth straight game and have lost 19 of their last 25 meetings with the Giants.

Headley reached the 20-homer mark for the first time in his career. The switch-hitter leads the majors in August with eight home runs and 24 RBIs.

"It's been nice to hit a couple of homers," Headley said. "You try to focus on wins and losses. When you don't win, it really doesn't matter to you."

San Francisco has scored 22 runs on 37 hits in three games since All-Star outfielder Melky Cabrera was suspended Wednesday for 50 games following a positive test for testosterone.

The Giants followed up the 15 hits they had in Friday night's 10-1 win over San Diego, when they broke loose for an eight-run inning, with 14 more on Saturday. Hunter Pence drove in two runs and Buster Posey had three hits and a sacrifice fly.

San Francisco remained in first place in the NL West by a half-game over the Los Angeles Dodgers, 6-2 winners over Atlanta.

Jose Mijares (1-0) retired the only two batters he faced to pick up the win. Jeremy Affeldt allowed two runs in the ninth before Clay Hensley got the final out for his third save.

Giants starter Barry Zito lasted only four innings before getting pulled for a pinch-hitter leading off the fifth. Zito allowed four runs and six hits.

Zito is 1-2 with a 7.37 ERA in his last five starts. At Petco Park, he is 0-3 with a 7.28 ERA in his last six starts.

Brad Brach (1-3) allowed two runs and four hits with a walk, retiring just one batter.

San Diego's Eric Stults couldn't hold a 4-1 lead. He gave up five runs and nine hits over six innings.

NOTES: The Padres scored more runs against San Francisco than they had in losing their previous four games, when they were outscored 28-2. ... Zito is 1-7 in his last 12 starts against the Padres. This was the first time in that stretch that he received more than two runs of support. ... It appears likely that Padres opening-day starter Tim Stauffer is done for the season. Stauffer, who made only one start, has been on the DL with a strained right elbow virtually all season. The right-hander is considering surgery to repair a flexor tendon. ... San Francisco has won 11 of its last 15 road games since the All-Star break, outscoring its opponents by a 110-50 margin. ... San Francisco RHP Ryan Vogelsong (10-6, 2.72 ERA), coming off his worst start of the season, opposes LHP Clayton Richard (9-12, 3.91) in the series finale Sunday.