SOUTH PORTLAND — Steve Stinson sensed that his South Portland High football players had been tight for the first half of their Western Class A game against Sanford on Friday night at Martin Memorial Field.

“The kids were pressing too hard in the first half; they made it harder than it had to be,” said Stinson, whose Red Riots trailed 12-7. “When I went in (at halftime) I knew they were going to be amped up. So I tried to be a calming influence.

“I told them to go out and have fun. They didn’t look like they were having fun in the first half. They looked like they were working.”

The Red Riots responded. They rushed for nearly 200 yards in the second half and rallied to defeat Sanford 29-25 in a back-and-forth game that wasn’t decided until the final play.

Matthew Stearns’ second touchdown run of the game, a 6-yarder with 4:15 remaining, put the Riots ahead for good. Hayden Owen intercepted a pass on Sanford’s next possession. But the Spartans had one last chance, and a pass into the end zone was batted down.

“We rallied,” said Stearns, who gained 108 of his 138 yards in the second half. “We talked to each other that we could fix it. We know we’re a good team.”

The victory was South Portland’s fourth in a row after an opening loss to Thornton Academy. Sanford lost for the third consecutive week to drop to 2-3.

“I’m tremendously proud of our effort,” said Sanford Coach Keith Noel. “That was a tremendous game.”

There were six lead changes, three in the final quarter, with South Portland’s special teams playing a big role.

Sanford took a 19-15 lead late in the third quarter on a 53-yard run by Eddie Michetti, his second touchdown of the game. Peter Hegarty’s PAT kick gave the Spartans a 19-15 lead.

South Portland punted on the first play of the fourth quarter, and Jaren Muller placed the ball at the Sanford 1. The Riots’ defense held, forcing a punt that Stearns returned 14 yards to the Sanford 25.

Six plays later, on fourth-and-goal from the 3, Nick Mezzanotte rolled right and found Muller. Mezzanotte’s PAT kick made it 22-19 South Portland with 7:20 remaining.

It took Sanford just two plays to regain the lead. On second down, quarterback Chase Eldredge found Peyton Wiegand open over the middle. Wiegand was hit by three defenders but never stopped and eventually broke free to complete a 71-yard touchdown. The kick was partially blocked, but Sanford led 25-22.

“We tell the kids to play until the whistle blows,” said Noel. “He kept his legs going and made a great play.”

A short kickoff gave the Riots good field position at their 37. After gaining a first down, Hayden Owen took the direct snap in the Wildcat formation and ran left through a huge hole for a 38-yard gain to the 6.

“That was all offensive line,” said Owen. “They have definitely stepped up this season.”

Stearns powered his way in on the next play, and Mezzanotte’s fourth PAT made it 29-25.

Sanford drove to a first down at the Riots 34, but Owen intercepted a pass at the 3. The Spartans then forced a punt, and a roughing-the-passer penalty gave Sanford a first down at the 34. But Eldredge’s final pass fell incomplete in the end zone.

“Slow motion, you know?” said Stinson, when asked about the last play. “I just thought, ‘Please drop incomplete. Can someone please knock it down?’ ”

Stearns was certain someone would.

“We knew what we had to do,” he said. “And we knew we were going to do it.”