– Kyle Gibson had Fenway Park hypnotized for eight innings Friday night. But Brandon Kintzler snapped his fingers in the ninth and promptly landed in danger.

Two singles, followed by an 11-pitch tussle with Xander Bogaerts that ended in a walk, loaded the bases for Boston with no outs. For David Ortiz.

The announced crowd of 37,001 was back to full throat, and Kintzler needed his power sinker to neutralize one of the game’s best power hitters.

“Neil [Allen] came out and said, ‘This is our double play dream here,’ ” Kintzler said. “This is the guy you’re going to roll up.’ You’re like, ‘Yeah, sure.’ ”

With the infield drawn in, Ortiz hit into a second-to-home-to-first double play. Then Hanley Ramirez lined out to right, and the Twins held on for a thrilling 2-1 victory.

The Twins improved to a still-woeful 2-38 when scoring three or fewer runs this year. They shook off their 13-2 loss to the Red Sox on Thursday and are 11-6 over their past 17 games.

Allen was right. And Kintzler, now with seven saves in as many opportunities this season, was glad his pitching coach was confident in him.

“It was a big moment right there,” Kintzler said. “It’s fun. It’s why we play the game. It’s not like I drew it up like that, but that’s what it is. It’s one of those moments where he is going to beat me or I am going to get him.”

Gibson (3-6) ignored the dangers of Fenway Park and the passionate fans that sat in its seats. Gibson pitched his game. And it was quite a game.

Gibson gave up a leadoff home run to Mookie Betts and an infield single to Dustin Pedroia in the first inning. Then he retired the next 14 Red Sox batters. He eventually left the game after eight innings and 96 pitches, having given up only those two first-inning hits as well as a sixth-inning walk.

“Everybody brings their best when they come to Fenway,” Ortiz said. “I saw his [5.12] ERA and I was like we got this. But he didn’t pitch like a guy with an ERA like that tonight.”

In two career starts at Boston, Gibson is 1-0 with a 0.60 ERA. His other start at Fenway was on June 18, 2014, when he shut out the Red Sox for seven innings on two hits and no walks with eight strikeouts in a game the Twins lost 2-1 in 10 innings. But Gibson received a game score of 81 on baseball-reference.com, the highest game score of his career.

Plenty of pitchers get chewed up here, but Gibson appears to be more than comfortable pitching the historic ballpark.

“It’s a lot of fun,” he said. “I caught myself lip-syncing ‘Sweet Caroline’ after the seventh-and-a-half inning.”

Gibson just needed some offense. Brian Dozier answered Betts’ blast with one of his own in the second inning off Eduardo Rodriguez, but the Twins mostly struggled with the Red Sox lefthander. It wasn’t until the sixth inning when they broke through again: Joe Mauer walked, which led to Rodriguez being replaced by Heath Hembree. The righthander walked Dozier to put two on for Miguel Sano, who worked the count full, then drilled an RBI double off the wall in center.

Gibson got through the eighth despite Sano dropping a routine infield pop-up for an error, the second time the third baseman has done that in a week. Gibson was under 100 pitches, but Twins manager Paul Molitor went with Kintzler for the ninth. The move looked disastrous three batters in, but Kintzler trusted his sinker.

“It took a little good fortune,” Molitor said. “A good baseball game for it being 2-1. You have to make a decision about giving Gibby a chance, and I went with the closer.”