BANGOR — At the time of the game when legs get heavy, when the basket feels 12 feet from the floor, not 10, the Forest Hills boys basketball team found that extra gear. Midway through the fourth quarter of Saturday’s Class D state championship game, when Fort Fairfield slowed down, Forest Hills sped up.

“You could see it at the four minute mark. We started getting to the front of the rim. All of a sudden, we could just get that extra step. These kids work so hard in the weight room and running in the offseason,” Forest Hills coach Anthony Amero said. “All of a sudden, layup, layup, layup. Our kids know they can get to the rim because the other team’s kind of hit that wall a little bit.”

Forest Hills scored 12 points down the stretch, and pulled out a 51-45 win at the Cross Insurance Center. The victory gave the Tigers their second gold ball in three seasons, and made Forest Hills (22-0) the only undefeated boys basketball team in the state this season. Fort Fairfield ends the season at 18-5.

“Amero has run us since day 1, hard, hard, hard. Just so we can outrun our opponents like this all season,” said Forest Hills senior Matt Turner, who hit a 3-pointer 25 seconds into the fourth quarter to give his team the lead for good, 35-33. Turner scored nine of his 11 points in the second half. Late in the third quarter, he made a 3-pointer that tied the game at 31-all.

“I knew I had to be a momentum spark. I thought a couple threes would do it,” Turner said.

When Fort Fairfield’s Hunter Beaulieu made a layup with just two minutes left to cut the Forest Hills lead to 45-42, Forest Hills went to what it does best, the inside game. Tanner Daigle’s layup with just over a minute left pushed Forest Hills’ lead back to five points, and the team made four of six free throws in the final minute to seal the win.

“We needed to get it into the paint. That’s where we do our damage,” said senior Ryan Petrin, who had 16 points and 18 rebounds for Forest Hills before fouling out with 1:33 to play. “Conditioning was the main goal this year. It definitely showed in the last four minutes of the game.”

Forest Hills scored the first seven points of the game, and led 11-4 after one quarter, before Fort Fairfield rallied. An 8-0 run late in the second quarter gave Fort Fairfield a brief 22-20 lead, but Forest Hills tied it going into halftime on Brandon Ouellette’s running layup at the buzzer.

Chris Giberson scored 13 of his team-high 15 points in the middle quarters for Fort Fairfied, but Amero felt his team did a good job limiting Beaulieu (nine points) in the low post.

“That Giberson kid, we weren’t going to stop him today. He was dialed in. I thought we could take away the big kid (Hunter Beaulieu), which was big for us,” Amero said.

While Fort Fairfield led throughout much of the third quarter, it could never push that lead over three points, and Forest Hills never panicked.

“We really just had to settle down. Just calm the ball down and make better shots and passes. We were going a little bit too quick, I thought,” Petrin said.

Added Amero: “If we’ll trade baskets, we’ll trade baskets and hope we get the last one.”

Isaac Cyr came off the bench to score 11 points for Fort Fairfield, including three 3-pointers.

“The whole tournament, we’ve taken care of the ball well. We’ve played under control. We’ve kept our composure,” Fort Fairfield coach Logan McLaughlin said. “Really, today, we seemed a little nervous. We seemed a little tight. We were just tight all around.”

For Forest Hills, the win caps the most successful four-year run in the school’s history. This was the third state game appearance in four years for the Tigers, who won the Class D title in 2013 and were runner-up in 2012.

“I just can’t get over my kids. This group of seniors, to go 22-0, with the amount of travel we do, with two baskets in the gym, they’re all heart, those kids. I’m just in awe of my own kids. It’s all them. I’m just along for the ride,” Amero said.