SAN FRANCISCO - Cole Hamels had thrown 101 pitches through six strenuous innings last night at AT&T Park.

The Phillies badly needed one more from him.

They needed to beat the San Francisco Giants to split the four-game series, and they couldn't turn the game over to a bullpen depleted by injuries. So manager Charlie Manuel and pitching coach Rich Dubee sent Hamels back out for the seventh. He delivered in an 8-5 victory.

Hamels threw a career-high 117 pitches, allowing eight hits, five runs (three earned runs) and two walks. He struck out nine.

"I think I pitch better when I'm tired," Hamels said. "It's one of those things for me that when I get in a groove, I bear down a little bit more. I think that first inning, it's all just adrenaline. It's excitement. You have to learn to control that. I think that's what those veterans do. I just need to get into that groove and that comfort zone."

Manuel couldn't speak highly enough about the way Hamels battled throughout, especially after he got through the seventh inning unscathed.

"I liked the way he battled," Manuel said. "He was determined he was going to get through the seventh. That's what I like to see. That might have been the biggest part of his performance tonight. He battled, but he battled in the seventh."

Hamels survived two costly errors by third baseman Wes Helms, which led to the two unearned runs, and benefited from more spectacular play from rightfielder Shane Victorino, a two-run home run from Ryan Howard in the third inning, and the one-out double Hamels hit in the sixth inning that led to his scoring the go-ahead run.

"That's the reason I love the National League so much," Hamels said. "I can actually help out."

Last night wasn't supposed to be about Victorino or Howard or Hamels' big hit. It was supposed to be a matchup between two pitching phenoms: Hamels and Giants righthander Tim Lincecum.

Hamels, the team's first-round pick in 2002, went 14-4 with a 1.43 ERA in 36 starts in the minors before the Phillies called him up last May. He entered last night 12-9 with a 3.95 ERA in 29 big-league starts.

Lincecum, the team's first-round pick last June, went 6-0 with a 1.01 ERA in 13 minor-league starts before he replaced Russ Ortiz in the Giants' rotation after Ortiz went on the disabled list.

Lincecum, who bears a striking resemblance to Alan Ruck's character Cameron Frye in Ferris Bueller's Day Off - only without the Detroit Red Wings jersey - was 4-0 with a 0.29 ERA in five starts this season for triple-A Fresno.

But Jimmy Rollins hit a leadoff single in the first inning and Victorino smacked a two-run homer to right field to hand the Phillies a quick 2-0 lead.

Victorino had a remarkable series against the Giants. He hit .588 (10 for 17) with one double, one home run, four RBIs, seven runs scored, six stolen bases and one walk.

"You've got to stay hot when you're hot," Victorino said. "I felt comfortable."

He the Giants last night by drawing a defensive interference call when he was caught stealing in the fifth inning.

Victorino was dead meat on the base path as he tried to avoid a tag, but while trying to avoid it he ran into Omar Vizquel on the infield grass. Instead of being called out for running out of the base path, Victorino was ruled safe by second-base umpire Gary Cederstrom. It proved to be a big call because Victorino eventually scored on a sacrifice fly by Aaron Rowand to hand the Phillies a 5-3 lead.

Giants manager Bruce Bochy didn't like the explanation he received from Cederstrom.

"He can create his own line," Bochy said Cederstrom told him. "I've never seen that before where he can go in the grass. I'm still [baffled] by it. . . . You can establish it and you need to stay in it, but you can't run into an infielder. He went right at him and that call hurt us. It cost us a run."

"Running into him was my only escape," Victorino said. "Once I saw him release the ball I said I'm going right for him to try to get an interference call. Fortunately enough, I got it."

Lincecum threw 100 pitches in 41/3 innings. He allowed five hits, five runs, five walks and two home runs. He also struck out five with his blazing fastball.

But Hamels was better.

"We're definitely going to be facing each other for a long time," Hamels said.

Geoff Geary threw a perfect eighth and Brett Myers threw a scoreless ninth to pick up his second save.

They saved the day, and the bullpen.

There's a chance Freddy Garcia might not be able to start tonight in Arizona after he bruised his left shin running into a maintenance cart during batting practice. If he can't start, Manuel might have the bullpen make it for him.

Contact staff writer Todd Zolecki

at 215-854-4874 or tzolecki@phillynews.com.

Read his blog at http://go.philly.com/zozone.