GORHAM — This one was fun to watch. And to play.

Gorham built a 15-point lead late in the third quarter, then had to hold on to defeat Greely 67-64 Tuesday night in an interclass girls’ basketball game matching perhaps the two best teams in southern Maine.

In winning their 24th consecutive game, the Rams had to withstand a frenetic rally by the Rangers, who missed three 3-pointers in the final 10 seconds.

Sophomore center Mackenzie Holmes was dominant inside for Gorham, scoring 32 points and grabbing 10 rebounds.

“A game like this is why I love to play,” said the 6-foot-1 Holmes, who is several inches taller than Greely’s tallest player. “It’s a close game. For both of us, blowout games are probably relaxing but I like it when it’s tight at the end. This is why everyone should be playing.”

The victory improved defending Class AA state champion Gorham to 3-0 in Class AA South while Greely dropped to 4-1 in Class A South.

Both teams went on runs throughout the game, though by different methods. Greely rained 3-pointers down on the taller Rams, hitting 13. Molly Chapin hit six 3-pointers and scored 22 points while Anna DeWolfe hit four 3s and led the Rangers with 23 points.

But Greely had no answer for Holmes, or for Gorham’s offense when the Rams ran their plays. Emily Esposito added 15 points for Gorham, along with six assists, while Kaylea Lundin had 13.

“We had some lulls where they kind of did what they wanted offensively,” said Rangers Coach Todd Flaherty. “And that’s when they went on their spurts. You just can’t let them run their stuff. They’re too good for that.”

Much of that was getting the ball inside to Holmes, who had just two points in her previous game. Michelle Rowe had six assists for Gorham, most on lob passes inside to Holmes.

Gorham’s biggest run came in the third quarter. Leading just 39-37 at the half, the Rams scored the first 12 points of the third to make it 51-37. The lead would peak at 55-40 on a Lundin basket. Even then, Gorham Coach Laughn Berthiaume wasn’t comfortable.

“The lead never felt it was that much because they can put points up in a hurry,” he said.

Indeed, Greely went on a 12-0 run, pulling within 55-52 on a DeWolfe jumper with 6:38 left. But Gorham responded: Holmes on an offensive rebound, Esposito a foul-line jumper and Holmes on a lob from Rowe, and it was 61-52.

Again the Rangers rallied, and a step-back 3-pointer from the top of the key by Chapin with 2:15 left made it 63-59. That’s when Holmes made her biggest play of the game. After getting the ball down low on the right, she turned to face a double-team then whipped a pass to Rowe on the backside for a layup and a six-point lead.

“In practice we work on that, if I get that double to make sure I find the open person,” said Holmes. ” Because if they get me the ball, I have to make sure I get them the ball. It has to work both ways.”

After an Esposito layup, Greely got to within 67-64 on a 3-pointer by Brooke Obar and a drive by DeWolfe. Gorham had to inbound the ball with 13.7 seconds left, but the Rangers came up with steal, then missed three 3-pointers.

“It was a tremendous game,” said Flaherty. “It lived up to its billing.”