PHILADELPHIA (AP) Denard Span delivered one of the Giants' biggest hits this season.
Span homered leading off the 10th inning, and San Francisco beat the Philadelphia Phillies 3-2 Thursday for just its fifth win in 14 games since the All-Star break.
''We needed this win more than ever,'' Span said.
San Francisco, which lost the first two games of the series, has not been swept by Philadelphia in 10 years.
''I'd say that's one of our bigger hits,'' manager Bruch Bochy said. ''It couldn't have come at a better time. To get a win here does a lot for the psyche and morale of the ballclub.''
Matt Moore made his first start for the NL West leader following his acquisition Monday from Tampa Bay. He allowed two runs and three hits in six innings and walked six - matching his major league high.
''It started with Matt,'' Bochy said. ''He did a terrific job, just a great effort on his part.''
Moore gave up one hit through five innings and took a 2-1 lead into the sixth, when Freddy Galvis grounded into a forceout with the bases loaded. Moore then threw a called third strike past pinch-hitter Taylor Featherston.
''I was maybe a tad bit geared up,'' he said. ''I just kind of calmed down and got back to simple things.''
Span led off the 10th by sending a 2-2, 95 mph fastball from Severino Gonzalez (0-2) just inside the right-field foul pole, his third hit of the game.
''I was just trying to protect,'' he said. ''I felt good this series and want to build off this.''
Sergio Romo (1-0) earned the win without getting an out. Cesar Hernandez was caught stealing for the final out of the ninth when he overslid the base while Romo was facing his first batter.
''We were disappointed in that,'' Phillies manager Pete Mackanin said. ''He stole that base easily and slid past the bag and we've addressed that at length with him because he has a tendency to do that.''
Santiago Casilla pitched a 1-2-3 10th for his 25th save in 30 chances.
Philadelphia starter Vince Velasquez gave up two runs and three hits in five innings.
Brandon Crawford hit an RBI single in the first, but Aaron Altherr's run-scoring double tied the score in the bottom half. Span hit a sacrifice fly in the fifth.
San Francisco put runners on first and second with no outs in the eighth. Brett Oberholtzer got three straight outs, the last on Altherr's diving catch on Brandon Belt's sinking liner to center.
Phillies: Velasquez called for a trainer in the fifth inning after he developed a blister on the middle finger of his pitching hand. The right-hander was able to pitch through the fifth, but Mackanin didn't let him go back for the sixth due to the blister.
''I didn't want to get him into a situation where he might miss his next start,'' Mackanin said. ''It wasn't a bad blister, but you could see it developing.''
Romo is the first pitcher since 2009 to earn a victory without officially facing a batter. Colorado's Alan Embree last accomplished the feat, on July 7, 2009. The previous Giants pitcher to do it was Tyler Walker on Sept. 17, 2005 against the Dodgers.
WALK THIS WAY
Philadelphia's Tommy Joseph walked a career-high three times. He had just 11 walks in 203 at-bats this season entering Thursday.
NEXT MAN UP
Mackanin said 22-year-old right-hander Jake Thompson will make his first big league start Saturday at San Diego. Taken by Detroit in the second round of the 2012 amateur draft, Thompson was acquired by the Phillies last season as part of the deal that sent left-hander Cole Hamels to Texas.
Giants: RHP Jeff Samardzija (9-7, 4.30) takes the mound for San Francisco when the Giants open a three-game series at NL East-leading Washington on Friday night.
Phillies: Philadelphia begins a six-game trip on Friday night in San Diego when RHP Jeremy Hellickson (8-7, 3.70) faces LHP Christian Friedrich (4-6, 4.72).