Madison Bumgarner is planning to pitch once more this season. After he started Tuesday and tossed seven innings, 12 relievers followed on a night the Giants and Rockies combined to use a major league-record 25 pitchers.

Colorado finally finished off San Francisco 8-5 early Wednesday morning when Charlie Blackmon hit a three-run homer in the 16th inning.

The game lasted 5 hours, 31 minutes, with Giants manager Bruce Bochy making 12 pitching changes — hardly taking it easy in his final week on the job.

Blackmon's first hit of the night came in his eighth plate appearance and off Dereck Rodriguez (6-10) for his 31st home run.

Both clubs left the bases loaded in the 11th, and Colorado stranded 15 baserunners.

This wasn't even the longest game between the clubs this season. The Giants beat the Rockies 3-2 in 18 innings and 5:35 on April 12 — the longest game at Oracle Park since an 18-inning loss to Arizona on May 29, 2001. Colorado also played two games of 16 innings or more in 2006.

Sam Howard (2-0) pitched the final two innings for the win.

With the Cardinals and Diamondbacks also going long, it marked the first time since June 8, 2013 — Mets-Marlins and Blue Jays-Rangers — more than one game went at least 15 innings the same day, according to MLB Stats.

Evan Longoria hit a tying homer in the eighth off Carlos Estevez. Longoria became the third Giants player with 20 homers, and for much of the game the ball carried on an unseasonably warm late-September night. First-pitch temperature was 78 degrees.

Garrett Hampson hit his second homer of the game to put Colorado ahead in the eighth after losing starter Jeff Hoffman to a knee injury from a line drive, but the Giants kept pushing. The Rockies got great news that it was only a bone bruise for Hoffman, who had crutches. X-rays were negative.

Trevor Story connected for his 34th homer after a pair of strikeouts to begin his night against Bumgarner, who was still scheduled to pitch Sunday's season finale against the NL West champion Dodgers though Bochy hinted beforehand there still could be a change if necessary and he didn't want the 2014 World Series MVP to feel obligated to start the manager's send-off game.

Bochy also would like this last week to finish on a winning, positive note for everybody involved.

"I'm here to help us win games and we'll see what happens," Bumgarner said. "But as of right now I'm planning on pitching Sunday."

Bumgarner drew big cheers as he walked to the mound to start the game, then struck out nine and walked two over seven innings, allowing four runs on six hits.

Hoffman took a line drive off his right knee in the fourth inning and was carted off the field. Alex Dickerson's sharp single hit squarely on Hoffman's knee and the pitcher went down writhing in pain, and the ball ricocheted toward San Francisco's dugout. He was down a little more than five minutes as athletic trainers from both teams tended to him on the mound.

"We'll see how we can deal with the pain and hopefully get ready for the next start," Hoffman said. "Between my kneecap and the right side of my knee — pretty much missed all the bones."

Buster Posey hit a two-run homer in the bottom of the first for just his seventh home run and first in 123 at-bats since July 31 at Philadelphia. Bumgarner added a homer of his own but the lefty remains winless in five starts since beating the Padres on Aug. 30. The Giants have lost his last four outings.

Ian Desmond hit a two-run homer in the fourth after Bumgarner hit Blackmon on the left hand area with a pitch to start the inning.

Bochy began what he knows will be an emotional final week on the dugout's top step. Fans stood and cheered when his picture showed on the big scoreboard during pregame introductions.

"It's going to be tough to say bye," Bochy said.

STORY'S MARK

Story homered against the Giants for a franchise-record sixth straight game and became the first Colorado player to do so against any opponent over six matchups in a row. Mike Schmidt (1979) and Rogers Hornsby (1922) each homered in five consecutive games vs. the Giants. Andres Galarraga homered in five straight vs. St. Louis in 1996.

TORRE'S VISIT

Joe Torre, now Major League Baseball's executive vice president of baseball operations, turned up before the game to offer his best wishes to Bochy.

"He's a special individual," Torre said after greeting the manager on the field.

A video tribute from Torre played on the big screen before the fourth inning and Torre said, "You're a class act and I admire how you go about your business."

TRAINER'S ROOM

Giants: Bochy was unsure whether RHP Johnny Cueto will make another start this season, saying after the game Cueto's bullpen session Wednesday will determine his status. Cueto (1-1) has made three starts spanning 14 innings since returning from a 13-month absence recovering from Tommy John surgery. His next turn would be Friday in the series opener vs. Los Angeles.

UP NEXT

RHP Tim Melville (2-3, 5.40 ERA) makes his seventh start of the year and the first of his career against the Giants having gone 2-0 with a 2.13 ERA in two road starts, beating NL West opponents Arizona and San Diego. RHP Jeff Samardzija (11-12, 3.64) has won two of his last three starts vs. Colorado and tries to match his career high of 12 wins accomplished in 2016 during his first year with San Francisco.