SAN FRANCISCO (AP) Two innings into his final start of the season, Giants right-hander Jake Peavy wasn't certain how long his afternoon would last.
Having rushed through his pregame warmups after speaking as part of a ceremony to honor retiring teammate Tim Hudson, Peavy knew his pitch count was up and his rhythm was off.
But just as he has almost every time out over the past six weeks, Peavy got back on track quickly to continue his most successful stretch of the year.
Peavy pitched five innings for his fifth consecutive win, rookie Kelby Tomlinson hit an inside-the-park home run and San Francisco beat the Colorado Rockies 3-2 on Saturday.
''It was obviously different getting the mindset to compete and then having to do that (ceremony),'' Peavy said. ''It just took me a minute to reel it in and really throw the ball where I needed to throw it to get most of the outs.''
Brandon Crawford and Marlon Byrd also homered for the Giants, who had lost two straight and three of four before powering up to beat the Rockies for the eighth time in 18 meetings this year.
It was the 12th time this season San Francisco hit three home runs or more in a game.
Peavy (8-6) allowed one run and four hits to improve to 5-0 over his last eight starts. He struck out two, walked one and retired 12 of his final 14 batters.
''He's really been locked in since he got back off the DL,'' Giants manager Bruce Bochy said. ''He had to work hard those first two innings, but he found a way. It's just his makeup. He finds a way.''
Ben Paulsen homered for the Rockies, who have lost four of five.
Tomlinson, whose only other home run came on Aug. 27, hit the eighth inside-the-park shot in AT&T Park history and the first since Angel Pagan did it on May 25, 2013. He benefited when Colorado center fielder Corey Dickerson and right fielder Carlos Gonzalez both paused to stare at each other briefly after chasing the ball down near the wall.
That gave the San Francisco rookie just enough time to slide home and easily beat the relay throw from second baseman DJ LeMahieu.
''It didn't really sink in until I was at second that I thought I had a chance,'' Tomlinson said.
One out later, Byrd hit his 23rd home run of the season and fourth with San Francisco to make it 2-0.
Crawford's 21st of the year put the Giants up 3-0 in the fourth.
All three of San Francisco's runs came off Rockies starter Chris Rusin (6-10). The lefty gave up five hits in six innings with four strikeouts and two walks.
''That's a lot of what we've seen from him this year,'' Colorado manager Walt Weiss said. ''Keeps the game intact throughout the outing and puts us in position to win games. If he can do that he's going to be very, very effective for us.''
Paulsen homered off Peavy leading off the fifth.
Dickerson doubled off Josh Osich and scored in the sixth to pull the Rockies to 3-2.
Five relievers combined to pitch the final four innings for San Francisco. Santiago Casilla retired two batters for his 38th save.
Nolan Arenado doubled for Colorado, extending his major league record for extra-base hits by a third baseman to 89.
HONORING HUDDY: Hudson, a 222-game winner and four-time All-Star, choked back tears while speaking to the crowd. The ceremony included video tributes from Hudson's former manager in Atlanta, Bobby Cox, along with several current and ex-teammates. Hudson received a standing ovation as he emerged from the dugout to join family and friends seated near the mound. Members of the Rockies stood near the railing in their own dugout to watch, and applauded as Hudson talked about winning a World Series championship in 2014. ''It put icing on the cake for me and my career,'' he said. ''For that I appreciate y'all.''
Rockies: C Tom Murphy exited with a strained left shoulder after getting picked off second base to end the fifth. He was replaced by Dustin Garneau.
Rockies: RHP Christian Bergman (3-1) pitches the season finale. He is winless in 11 appearances on the road despite a 2.37 ERA.
Giants: RHP Matt Cain (2-4) will make his first start since Aug. 25 in the last game of the year for the defending World Series champs. Cain has won once in his four starts at AT&T Park this season.