Thomas Jefferson's Edson Avila (pictured above) and South Shore's Wayne Martin got into a fight during the Vikings' 69-64 victory on Thursday.christina santucci

South Shore finally picked up the signature win it has been in search of, but a bench-clearing incident that included several fans overshadowed the win, The Post has learned.

Moments after Thomas Jefferson’s Edson Avila and South Shore’s Wayne Martin got into it early in the third quarter, the partisan South Shore crowd stormed the court, Orange Wave coach Lawrence (Bud) Pollard said, with the intent to go after Avila, a 6-foot-8 Manhattan College-bound forward. At the same time, the two benches cleared as South Shore coach Mike Beckles and his staff got in between the mob and Avila, Pollard said.

Several punches were thrown, Pollard said, but security was able to diffuse the situation and the game resumed after much of the crowd was ushered out of the gymnasium. Avila and Martin were both ejected. Only parents and the two JV teams were allowed to remain.

“It was pandemonium, but I thought their staff and security did a good job,” Pollard.

Avila told Pollard that Martin punched him in the face, igniting the fracas, though South Shore guard Terrence Samuel said he didn’t see either player throw a punch, but did notice the two did exchange a few shoves and elbows with the referees backs turned. He didn’t see anyone in the crowd throw a punch, but was told punches were thrown. Samuel felt the skirmish only happened because “both teams were being immature. One team could’ve not let it get to them.”

“If you said any of our kids did anything, I’d probably believe it, but not Ed,” Pollard said. “That kid has been trying to punk Ed since the first game. He’s the nice guy on my team.”

South Shore (7-7, 4-4 Brooklyn AA) would rally and take a 69-64 victory, its first over a Brooklyn power this season, behind 22 points from Danny Thompson and 12 points and 10 rebounds from Shamiek Sheppard. Shamel Williams paced Jefferson (8-6, 6-2), which has now lost four of six, with 26 points.

“We made a statement,” Beckles said. “Even though we’re young, we feel we’re one of the best teams in the city. … It’s a big win for our team. Because when we played them the first time, I felt we should’ve won. We were up by 17 points. We just executed and for me, it was learning to play hard the whole game and we did that today.”

Trailing at the time of the brawl, South Shore came alive afterward while Jefferson seemed to wilt. Sheppard was instrumental in the victory, scoring eight points in the fourth quarter while the Orange Wave desperately missed Avila’s shot-blocking and rebound in the paint.

“It motivated them and took some starch out of us,” Pollard said.

Suspensions are certain to follow for Avila and Martin, and the two teams could be in danger of forfeiting future games. PSAL rule 22.1., known as the “brawl rule,” states: “In the event of an altercation, if teacher/coaches lose control of their benches, and both benches clear to participate in the altercation-that game will be declared a double forfeit and both teams will forfeit a minimum of the next two scheduled league games.” The rule also reads: “The PSAL Director may impose further sanctions if there is evidence that such sanctions are warranted.”

Additionally, players ejected from a game routinely receive two-game suspensions.