SAN FRANCISCO -- Tim Lincecum was still cheering Bengie Molina's home run when Pablo Sandoval connected moments later for his first major league homer.
Those two timely solo shots in the seventh inning lifted Lincecum to another impressive victory, and the San Francisco Giants avoided a three-game sweep with a 4-1 victory against the Colorado Rockies on Wednesday night.
"It was big," Lincecum said.
After Molina's one-out homer off Livan Hernandez tied the game at 1, Sandoval sent the first pitch he saw into the tunnel just inside the left-field foul pole -- and that was it for Hernandez (1-3). It marked only the second time this year San Francisco has hit back-to-back home runs. Molina and Aaron Rowand did it May 23 at Florida.
"That's never happened in my life," Sandoval said. "My dream is complete, hitting my first home run. That was the best moment. ... I thought (it had a chance) because that was the best pitch I had to hit. He threw a good game and made two mistakes."
Lincecum (15-3) struck out 10 to boost his majors-leading strikeout total to 210 and he owns the 10th highest season strikeout total in San Francisco history. Lincecum lowered his ERA from 2.48 to 2.43, tied for best in the big leagues with Cleveland's Cliff Lee. Lee and Lincecum both have allowed 50 earned runs in 185 1/3 innings.
"That's a strange coincidence," Lincecum said. "He's doing a great job. It's funny we have the same numbers. It's great to be there now, but you kind of look at where you are at the end of the season and gauge from that."
The crowd at the Giants' waterfront ballpark roared in delight when Lincecum came out to start the eighth, then booed manager Bruce Bochy when he removed the All-Star after two outs and a career-high 132 pitches. Lincecum walked off the mound to a standing ovation.
Bochy was willing to let Lincecum start the eighth despite his high pitch count. Lincecum walked Willy Taveras with one out before retiring Matt Holliday on a flyout to right.
"We checked on him going into the eighth and he said, 'I feel great,' " Bochy said. "He ended up throwing some pitches on that walk. You have to do this a step at a time. These guys get extended sometimes. He will get an extra day, so that will help."
Lincecum won three starts in a row for the first time since April and won his fourth consecutive decision, improving to 13-2 in 22 starts following San Francisco losses. Lincecum allowed five hits and walked three in 7 2/3 innings.
The 24-year-old right-hander struck out the side in order in the third, getting Holliday on a called third strike clocked at 96 mph. Lincecum had his seventh 10-strikeout game this season -- tied for third-most in San Francisco history -- and ninth of his career.
"He's a throwback for Giant fans to Juan Marichal," Rockies manager Clint Hurdle said of the Hall of Famer. "He gets on top of the ball. He's like a whirling dervish out there. He's got some deception, he's got thump with the fastball. He's got a sharp breaking ball, he's got a slider. And, then, he has that filthy changeup. He was on tonight."
After Jack Taschner allowed a single to Brad Hawpe, he was quickly replaced by closer Brian Wilson. Wilson got Garrett Atkins on a foul pop up to end the eighth, then worked the ninth for his NL-best 36th save in 39 opportunities.
The Giants scored two insurance runs in the eighth, one on an error.
Troy Tulowitzki hit an RBI single in the second for Colorado's lone run. The Rockies missed a chance to pull within five games of NL West-leading Arizona.
Dave Roberts tripled with one out in the sixth for San Francisco, but was thrown out at home on a double play that ended the inning after Fred Lewis flied out to center and Taveras made a perfect throw to the plate.
At 15-11, the Giants guaranteed their first winning month since August 2007. ... Lincecum's previous career high for pitches was 122. ... Colorado RHP Matt Herges, on the DL since Aug. 20 with lower back stiffness, was set to begin a rehab assignment with Triple-A Colorado Springs. He is likely to play two out of three days then rejoin the Rockies on Sept. 2, the first day he's eligible to be activated. ... Injured Giants pitchers Noah Lowry (forearm surgery) and Merkin Valdez (strained elbow) are scheduled to throw off a mound in Arizona this weekend while the team is on the road. ... Giants LHP Jonathan Sanchez is slated to come off the DL and return to the rotation Monday at Colorado. Sanchez was scratched from his start against Atlanta on Aug. 16 and placed on the DL with a strained throwing shoulder.