CUMBERLAND — If timing isn’t everything in basketball, it’s pretty important. It’s right up there with scoring inside, rebounding and shutdown defense.

Greely put it all together Tuesday night, as Michael McDevitt scored 27 points and pulled down 10 rebounds and had five blocked shots to lead the Rangers past Fryeburg 71-51 in a Western Class B boys’ preliminary-round game.

Greely (10-9), the No. 7 seed, advances to a regional quarterfinal with No. 2 York (17-1) at 12:30 p.m. Saturday at the Portland Expo.

No. 10-seed Fryeburg finishes at 10-9.

“Our trouble has been starting games,” said point guard Jonah Normandeau. “Tonight we got going right away, and we weren’t going to stop.”

The Rangers certainly did, with a pressure defense that limited Fryeburg’s shots and the play of 6-foot-7 McDevitt and 6-4 Connor Hanley (15 points, seven rebounds) controlling the boards. Greely went on an 11-0 run in the first quarter to open a 13-5 lead on the way to a 16-8 advantage after one. Greely maintained control in the second quarter to go into halftime with a 33-18 lead.

“We came out with a lot of energy and defensive intensity was a lot better,” McDevitt said. “Tonight we showed we can perform at the level we should be performing at.”

There were few secrets between these teams, which split the regular season series. Greely, which favors an inside game, beat visiting Fryeburg 65-59 on Dec. 15, and the Raiders, who shoot from the outside, won in Cumberland, 46-37 on Jan. 26.

“Greely really executed a good game plan tonight,” Fryeburg Coach Sedge Saunders said. “We never got into a rhythm. They played their zone really well, so we didn’t get a lot of good looks. Even when we got turnovers, we didn’t convert, and if you don’t convert against this team early on, you’re probably in for a long night.”

Entering the third with a 15-point deficit, the Raiders turned to a lesson they learned in the regular season, which they opened 0-6 and closed 7-0: Don’t give up.

Suddenly the Raiders were finding the basket, going on an 11-7 run to go ahead 49-38. Fryeburg matched Greely’s 22 points as Jaquan Causer scored six of his 11 points, Walker Mallory had seven of his nine and Tyler Saunders had five of his eight.

“There was a big emotional swing in the game,” Greely Coach Travis Seaver said. “They become a completely different team once they start hitting shots.”

Part of the explanation might have been the absence of Hanley, who picked up his fourth foul with 5:47 left in the third and sat for the rest of the period.

“Our game comes a little slower offensively when Connor’s off the floor,” Seaver said.

Hanley started the fourth quarter and scored four points to push Greely’s lead to 59-45 before he came out again. By then, Normandeau had the defense back on track.

“They hit a couple of 3’s so we had to crack down hard, rotate and trap down low,” he said. “It was just an adjustment we had to make.”

McDevitt, who hit 10 of 11 free throws, scored seven of his 13 second-half points from the line, and Greely hit 88 percent from the line (22 of 25).

“This was a team effort all around,” Hanley said. “They had that run in the third, but basketball’s a game of runs. We just had to weather the storm.”