GORHAM — In a game that featured eight ties and 17 lead changes, the Scarborough boys’ basketball team relied on its big-game experience and the clutch play of Nick Fiorillo to survive Gorham, 59-54, in a Class AA South quarterfinal Wednesday night.

The fifth-seeded Red Storm, who won the region a year ago, trailed the fourth-seeded Rams 54-53 with just over a minute to play. Fiorillo then hit a jumper for the lead and Fiorillo and Tyler Gobeil each made two free throws for Scarborough.

Fiorillo led all scorers with 26 points and the Red Storm (11-8) advanced to meet top-ranked Thornton Academy (15-4) in the semifinals at 8 p.m. Tuesday at Cross Insurance Arena.

“We played a lot in the Civic Center and we wanted to get back there,” said Fiorillo, who also had nine rebounds, two assists and two blocked shots. “I thought if we didn’t get there, the season would be a failure. We’re excited to go back there.”

The first quarter featured three ties and six lead changes. A putback from Brian Austin just before the buzzer forged a 16-16 tie.

Austin and Fiorillo remained hot in the second quarter, sparking a 6-0 run that gave Scarborough a 25-20 lead.

After a timeout, Gorham answered and when Grant Nadeau hit a leaner with 2.2 seconds to go, the Rams pulled even again, 32-32.

The back and forth continued in the third quarter as the Rams held Fiorillo scoreless, but Paul Kirk scored eight points.

Gorham surged ahead behind a pair of 3s from Bode Meader and clung to a 46-45 advantage entering the fourth quarter.

The game was tied, 48-48 and 50-50, but when Jordan Bretton drove for a layup with 2:13 remaining, it gave the Rams a 54-53 lead.

But Fiorillo’s jump shot in the lane with 1:12 left gave Scarborough the lead for good.

“I got the ball off the handoff, saw some separation and my guy sagged off and I was able to get the extension and hit it,” Fiorillo said.

“I believe Nick’s the top player in the SMAA and he showed it tonight,” said Red Storm Coach Phil Conley.

After a Gorham turnover, Fiorillo made two free throws.

After Meader missed a potential tying 3, Gobeil got the rebound, was fouled and made both free throws.

The Rams were paced by 11 points apiece from Bretton and Nick Strout and 10 each from Grant Nadeau and Tom Nelson, but couldn’t convert with the game on the line.

“I think we put ourselves in a position to win the game late and we had a couple shots, but we just didn’t knock them down,” said Gorham Coach Mark Karter. “The guys did a great job all year. I thought we took a lot of steps forward, but we couldn’t take that one more today.”

Scarborough lost 49-43 at Thornton Academy in its regular-season finale Feb. 5, but looks forward to another shot at the Golden Trojans.

“Now, we’re in the final four and I couldn’t be happier,” Conley said. “We’re looking forward to the rematch. They’re a good team and it should be a very good team.”