DENVER — Seth Lugo figured extended duty was almost a certainty for him Wednesday given the Mets’ schedule. But Lugo couldn’t have anticipated it unfolding in quite this manner.

In addition to recording the final six outs in the 7-4 victory over the Rockies, the right-hander batted in the ninth inning and delivered an RBI single for the Mets’ final run. Lugo’s at-bat was his first of the season.

Joe Harvey had already walked Pete Alonso with the bases loaded to snap a 4-4 tie, and the Mets added an insurance run before Lugo came to the plate.

“I saw [Harvey] miss around Pete’s face, and with those shadows I wasn’t too comfortable up there the first couple of pitches,” Lugo said. “I kind of had been waiting for an at-bat all year.”

Manager Mickey Callaway indicated the plan was to let Lugo hit in the ninth if the Mets had even a one-run lead.

Alonso’s home run in the sixth inning not only tied him with Mark McGwire for the second-most homers by a rookie (49), but also established a franchise record with the team’s 225th of the season. The 2017 Mets held the previous record.

“We still have got some ball left, and hopefully we can extend that a little bit,” Alonso said.

Callaway praised the Mets’ approach.

“We never talk about home runs,” he said. “Not in spring training, not during the season. We talk about staying through the ball and taking a good approach with runners in scoring position, hitting the ball the other way if we need to against the shift and I think when you take the right approach you are going to have better numbers and that shows with the homers we hit.”

Robert Gsellman (lat) survived a second bullpen session without discomfort and will likely throw from a mound in Cincinnati before team officials decide if he is ready for a simulated game. The right-hander has been on the injured list since Aug. 14 with a partially torn lat.

Brandon Nimmo was doubled off first base in the seventh inning on Jeff McNeil’s bloop to left field that was caught by Ian Desmond. Nimmo, according to Callaway, believed second-base umpire Ryan Blakney gave the “safe” signal and therefore started toward second. But the call belonged to third-base umpire Chad Fairchild.

“I’m not sure what Nimmo saw Ryan do out there, but [Blakney] indicated he didn’t signal safe,” Callaway said.

Purchase event tickets to The Amazin’ 1969 New York Mets: A World Championship for the Ages presented by The Paley Center for Media and New York Post. Enter promo code: NYPOST to unlock tickets only available for Post readers.