DURHAM — Division I boys’ basketball teams knew what was coming when they saw Salem High on the schedule this season. The Blue Devils might not blow you away offensively, but their defense would be game for whatever an opponent threw at them.

Salem went back to its calling card on Wednesday with the stakes as high as ever and it paid off once again in a 40-26 semifinal win over defending champion Portsmouth at UNH’s Lundholm Gymnasium. The second-seeded Blue Devils held the sixth-seeded Clippers to eight field goals and 22 percent from the field. Portsmouth scored no more than 10 points in a quarter and was held to scoreless in the fourth, which Salem won 6-0.

“Keeping them scoreless in the fourth was incredible,” said Salem coach Rob McLaughlin, whose Blue Devils will play either No. 1 Exeter or No. 4 Londonderry in Saturday’s 3 p.m. title game at UNH. “We were real good defensively. You never know what’s going to happen when you get up here. These guys have shown up for every challenge this year and tonight was no different.”

The fourth-quarter stymie was impressive, but the work put forth by Salem’s Mike Ference and Jared Burns on Portsmouth’s Alex Tavares, the Division I regular-season scoring leader at 31 points a game, was exceptional. The Blue Devils’ duo were Tavares’ main adversaries throughout the night and the Portsmouth senior was hung out to dry, scoring just three points on 1-for-8 shooting.

“We’ve been using those two guys on the other team’s best player all year,” McLaughlin said. “Just trying to eliminate what that guy does and disrupt stuff. I thought they were both phenomenal and I can’t say enough about them. I’ve been saying right along that I think Ference is the best defensive player in the state and tonight you saw why.”

McLaughlin pointed to Ben Laycock (14 rebounds) as another big part of Salem’s success as the 6-foot-6 center erased Portsmouth’s second-chance opportunities and clogged the paint the entire night. The Blue Devils were led offensively by Kyle Poulin’s 13 points and Zack Caraballo offered up 12.

Cal Hewett took the lead for Portsmouth with 11 points while Jacob Boutin pitched in eight.

Salem’s offensive approach varied throughout the season, making it no surprise when the Blue Devils settled on going inside as often as possible. Advantages in points off turnovers (11-2) and points in the paint (24-6) fueled Salem’s attack.

“I think we were looking to get the best shots,” Poulin said. “We saw them coming out on us early on, so we knew we could penetrate and get to the basket. When they started closing in then we were kicking out, which is where you saw some of our outside shots.”

A 23-16 Salem lead at halftime jumped to a 14-point edge courtesy of a 7-0 Blue Devils run to start the third quarter. Portsmouth did reel off eight consecutive points after Salem’s start, making Salem’s early run crucial to its cause.

“When we played them in the regular season we got out 22-2 or something at the start, but then we came out of halftime and they jumped us early,” McLaughlin said. “We needed to come out of halftime tonight and make a statement. If we let them get up on it, then it’s a battle all the way through. If we made the run and pushed it to that double-digit range, then you give yourself breathing room.”

Portsmouth coach John Mulvey thought his Clippers were turning a corner with their response to Blue Devils’ start to the third quarter. Portsmouth ended up going 0-for-14 the remainder of the game after matching Salem.

“We just couldn’t make shots. We got some decent looks, too, and those were definitely shots we had been making during the season,” Mulvey said.

“We finally got those stops and seemed like we were ready to get back into the game but never got over that hump. Couldn’t finish it or get one of those big shots to fall.”