PORTLAND — Phil Conley walked into the Scarborough High’s boys’ basketball team’s locker room and let out a yell:

“Are you kidding me?”

And the celebration began with a roar. Finally, Scarborough is playing in a boys’ basketball state championship game.

The top-ranked Red Storm used near-perfect foul shooting in the fourth quarter to pull away from second-ranked South Portland, 55-43, in the Class AA South championship game Friday night at the Cross Insurance Arena. Scarborough’s players hit 14 of 15 foul shots in the fourth to secure the school’s first boys’ regional championship.

“It means the world to me, to get a regional title for Scarborough High,” Conley, the Red Storm’s coach, said. “Athletic director Mike LeGage believed in me two years ago when I applied for the job. And I’m glad that the guys bought into my system and we won a title.”

Scarborough (17-4) will play its first state championship game at 9 p.m. March 2 at CIA, facing Edward Little, which hasn’t won a state title since 1946. South Portland, which had won the last two South AA titles, finishes 15-6.

“This is crazy,” said Scarborough junior forward Nick Fiorillo, who was presented the George Vinall trophy as the tournament’s outstanding player. “I don’t even know what to say. We worked so hard all year. We still got one more game to go.”

Morgan Pratt led the Red Storm with 14 points, while Fiorillo had 13 and Jaquan Seme 11. The three of them hit 11 of 12 foul shots in the fourth.

“After every drill in practice we go 20, 25 at the line,” Fiorillo said. “Coach keeps track of them. It’s something we don’t joke around with, and this is why.”

This was not an easy game. Defenses dominated for the most part. The score was 19-19 at the half and 33-30 entering the fourth.

There, Scarborough quickly pulled away. Fiorillo started it with two foul shots. A Pratt layup off a great back-door pass from Zoltan Panyi made it 37-30 and forced a South Portland timeout.

“We knew how badly we wanted it and we knew we had to pull away if we wanted it to make the game ours,” Pratt said. “We were just able to execute and take control of the game.”

The Riots came out and got a long 3-pointer from Noah Malone, who led them with 16. But Fiorillo scored inside, on a lob pass from Reece Lagerquist. The Red Storm forced a turnover on the press, leading to a three-point play by Brian Austin (a back-door cut from Fiorillo, followed by a foul shot) and it was suddenly 42-33. After another South Portland turnover, Paul Kirk hit two foul shots and the lead hit 11.

“They made some shots and we didn’t,” said Kevin Millington, the South Portland head coach. “I know it sounds pretty simple. But games happen with little runs like that and if the clock is such at a certain time … if that’s in the first quarter, we’d be able to climb back because there’s plenty of time. The timing of that run was such that we had to play differently.”

The Riots had to foul. The Red Storm were nearly perfect. In fact, they hit 16-of-18 foul shots in the game.

“Coming in, we were really confident, but I think it’s just now setting in what this means,” Pratt said. “We’re pretty fired up.”