SCARBOROUGH — Junior forward Nick Fiorillo said in order for Scarborough to be considered one of the best boys’ basketball teams in Class AA, it still needs to beat South Portland, the two-time defending Class A South champion and the only team in the region ranked ahead of the Red Storm prior to Saturday.

But after a gritty 69-66 victory over Portland – the first loss in 12 games this season for the two-time Class AA state champion – it’s clear Scarborough is a contender.

After seeing its 12-point halftime lead turn into a 51-47 deficit entering the fourth quarter, Scarborough showed its mettle in the final eight minutes, during which there were six lead changes and three ties.

Morgan Pratt broke a 66-66 tie when he hit a pair of free throws with 11 seconds remaining after he was fouled dribbling the ball at the top of the key.

“We talk about mental toughness all of the time, and our kids had mental toughness today, and they responded in the fourth quarter,” Scarborough Coach Phil Conley said. “Portland is one of the top teams in the state for a reason, and I think we showed people today that we are a top team, too.”

Fiorillo paced Scarborough (10-3) with 26 points and nine rebounds. Pratt, who went 7 for 10 from the free-throw line, added 18 points and six assists. Brian Austin chipped in with 15 points, including 12 in the second quarter, when the Red Storm outscored the Bulldogs 27-9.

Austin’s biggest play came on the defensive end in the waning seconds. With his team leading 68-66 after Pratt’s free throws, the sophomore stepped in front of Portland star Terion Moss to draw an offensive foul with 3.4 seconds left.

“We talk every day in practice, ‘Who’s going to be the one? Who’s going to be the one to get on the floor and take a charge?’ (Brian) was the one to do it,” Fiorillo said. “Good for him.”

“He had few options there; the ball was definitely going to be in Terion’s hands (at the end),” Portland Coach Joe Russo said. “I said I might as well go down with our best player (taking the last shot).”

Moss finished with 19 points, including his 1,000th career point on a floater in the lane with 6:11 left in the second quarter. He joins Robert Pillsbury and Rocco Toppi as the only Bulldogs to achieve the feat.

Russo said the loss might be good for Portland (11-1), as he noted his team has had few close games.

“We haven’t been in that spot in a long, long time,” Russo added. “We go over it in practice and emulate it, but that isn’t the same.”

Moss gave his team its last lead, 60-59, on a shot down low with 2:32 left, but Fiorillo answered with a 3-pointer from a Reece Lagerquist assist 16 seconds later.

Scarborough led 65-61 after a Lagerquist reverse layup and a Pratt free throw, but Portland clawed back on a 3-pointer and a backdoor layup by Simon Chadbourne (16 points).

The victory was the biggest in Conley’s two-year tenure at Scarborough. The Red Storm went 7-13 last season.

“We owe Coach Conley a big win,” Fiorillo said. “This is his second year here and he’s totally changed us around. So I give him all the credit. We knew we can compete with anyone, and (we) still believe it.”