In the first couple of minutes of Albemarle’s Class 5 state quarterfinal match with Wakefield, the Patriots nearly scored off a Brandon Mahon free kick. So when he got a chance just across the midfield line with 10 minutes left — only a couple of minutes after a devastating red card that led to a converted penalty kick and a lead for the Warriors — he was certain his teammates would figure out a way to finish.

“We almost scored in the first minute or two and I just knew if I did it one more time we could do it,” Mahon said. “I’m just so thankful it went in.”

Mahon struck the ball perfectly, Mohamed Abajar elevated what appeared to be three feet above the crowd in front of the net and headed it in to equalize. Three minutes later, Mahon scored on a strike of his own to put the Patriots up and complete the incredible rally.

Mahon’s goal allowed Albemarle to escape with a 2-1 victory at home and advance to the state final four. They’ll play the winner of Briar Woods and Mountain View’s state quarterfinal at 4 p.m. Friday at Glen Allen.

After Ricardo Saldago converted the penalty kick for Wakefield with 12:41 to play, Mahon was particularly determined to erase that deficit.

“I’m still in shock about the whole thing, it’s so unfortunate we had to give up the penalty but my best friend Andrew Weber is on this team, he’s a senior and I couldn’t let that be the last game we had together,” Mahon said. “That would’ve haunted me forever if that was our last game.”

After Abajar came up with the header, that opened the door for Mahon. After a throw-in near the Albemarle bench, the ball found its way to sophomore Nicholas Matavelli, who flicked it out near the corner of the box to Mahon. Muscle memory took over as Mahon collected and struck on a shot to the back post he’s taken and converted a number of times for his club team this year.

“I was more happy when he scored than my goal because we knew at that time we were going to the state (tournament,” Abajar said.

It helped Albemarle’s cause that despite that penalty kick, the defense was tremendous throughout, erasing possessions either by virtue of proper positioning and hard tackles or the fist of goalie Thomas Leckrone. He had a particularly critical save in the game’s early going when he leapt to his left and punched the ball out.

Albemarle had the run of play and possession throughout, with striker Daniel Starr absorbing a lot of attention and a veritable beating on long runs. At several points three Wakefield defenders appeared to be concentrated on Albemarle’s most prolific goal scorer, and he still managed to find ways to create chances. Weber faced a similar onslaught, absorbing a lot of physical play in the offensive half. Still no goals came until the Patriots’ backs were against the wall, and with Wakefield concentrating on Starr and Weber, Abajar and Mahon instead provided the finishing touches.

Even with that late deficit, it’s clear just how confident Albemarle was that they were going to come back and rally.

“I had no doubts that that wasn’t going to be the end of the game,” said Albemarle coach Zach Laird. “That we were going to get some more chances and we just had to finish.”

The Patriots honored injured senior Nick Buck with a ceremonial kickoff to start the game and it was clear that the fate of those seniors’ careers weighed heavily on Albemarle’s players.

“For Nick Buck and all our other seniors we had to pull through and get this win,” Mahon said.

Abajar echoed that sentiment.

“We’ve just been working hard all season and we lost a player (Nick Buck) just because he was working so hard for our team so we’ve got to do this thing for him,” Abajar said.

Now they’ll get a chance Friday at 4 p.m. against Glen Allen to take another step.