Zach Reali picked the perfect time to score his only basket.

With the game tied and time winding down, Reali, who entered the game after starting forward DeSean Cromwell fouled out, put in an offensive rebound at the buzzer to give second-seeded Biddeford a 50-48 victory over No. 7 Brunswick in a Class A South boys’ basketball quarterfinal Saturday night at the Portland Expo.

“I noticed my guy didn’t crash (the boards), so I went in and got it and put it up,” said Reali, a senior who finished with three points. “I’m just a role player, so I figured (when I went in) that I would do my role, like hand the ball off to the guards and set screens.”

Biddeford (16-3), which advanced past the quarterfinals for the first time since the 2003-04 season and for only the third time in more than 30 years, will play Westbrook at 6 p.m. Wednesday at Cross Insurance Arena.

“Kyle (Norton) did a real good job at waiting to take the last shot, a great job controlling the pace,” Tigers Coach Justin Tardif said. “He did a good job attacking the rim and Zach was in the right spot at the right time.”

Brunswick (12-7) made a furious comeback in the final minutes, finally making it 48-48 when Dawson Hebert scored on a layup after Kyle Hanson tipped a pass on a full-court press.

Colby Bucknam brought the Dragons within two points 10 seconds earlier with a three-point play. He had 25 points.

“I felt we executed our game plan perfectly by keeping the score in the 40s and not getting in an up-and-down (the court) game with Biddeford,” Brunswick Coach Todd Hanson said. “We just came up one possession short.”

Cody Saucier took over in the second half with 13 of his team-high 20 points, but it was Norton who helped extend Biddeford’s fourth-quarter lead.

Norton drained a 3-pointer and followed with a three-point play in a 41-second span to push the lead to 45-37 with 3:09 left.

The teams traded the lead three times early in the second half. A layup by Carter Edgerton and a basket down low by Saucier gave Biddeford a 28-25 lead.

Sam Sharpe cut the Tigers’ lead to 30-29 late in the third quarter, but Saucier split two defenders for a layup at the buzzer.

The first half was close throughout. Brunswick slowed the pace in the second quarter and picked out shots, turning a 16-14 deficit into a 23-22 lead.

Saucier made a foul-line jumper and a 3-pointer in a 27-second span midway through the quarter to put Biddeford up 22-17, but the Dragons closed the half with six straight points. Hanson broke a 3:35 scoring drought for his team with a top-of-the-key 3-pointer off Cameron Dunton’s handoff. Dunton then gave Brunswick its first lead since 6-5 midway through the first quarter when he hung in the air on a baseline drive and hit the layup while being fouled.

The early stages of the game was a battle of the big men, as Bucknam scored 10 of Brunswick’s first 12 points and Biddeford’s DeSean Cromwell got seven of his team’s first eight points.

Bucknam’s 15-foot baseline jumper tied the game at 14-14 before Saucier beat the first-quarter buzzer with a layup.