AUGUSTA — After his heart rate came down, Valley boys’ basketball coach Wade Morrill was quick with a quote to describe what happened Wednesday in the last five seconds of his team’s Western Class D semifinal against Hyde.

“Jack Nicklaus, the great golfer, once said, ‘The harder you work, the luckier you get,’ ” Morrill said.

It took a lot of hard work and a little luck for the third-seeded Cavaliers to advance to their first regional final since 2008.

Valley tied the game on a lay-up by Dylan Belanger with 5.1 seconds left, gained possession when second-ranked Hyde was called for a back-court violation, then won it on a pair of foul shots by Carrington Miller with 3.3 seconds left to earn a 55-53 victory at the Augusta Civic Center.

“Down by two with about 26 seconds left, and panic starts to set in,” said Josh West, who scored 20 points for Valley. “Luckily (Jordan Gillespie’s) good defense forced the backcourt, and we got the ball inbounds and got fouled.”

Valley (17-3) will play top-seeded Forest Hills (18-2) in the regional final Saturday.

The Cavaliers trailed by two after Wondo Shaw of Hyde (16-4) hit a foul shot with 1:04 left. The Cavaliers missed a shot and turned the ball over, but Warsame Mohamed, who finished with 24 points, missed the front end of a 1-and-1, giving Valley a chance to tie.

Miller drove to the basket and dished off to Belanger, who made his first basket of the tournament with 10 seconds left.

Hyde called a timeout with 5.1 seconds left and inbounded the ball at midcourt. The ball was inbounded to Wilson MacMillan, who was forced into the backcourt, giving Valley possession.

“The difference in that ballgame was the last five seconds,” Hyde Coach Peter Rowe said. “If we execute the last play, best-case scenario we win, if not, we go to overtime. We didn’t execute the play.”

The play, Rowe said, was designed to get a backdoor lob to Mohamed.

“We didn’t make the pass and he didn’t make the cut.”

On the ensuing inbounds play, Valley passed the ball to Miller, who was fouled immediately. He sank both free throws, and Mohamed’s desperation 3 was no good.

“I was just looking to get the ball and create my own shot,” Miller said. “Luckily I was able to get the ball and I was hit in the face, and I made two big foul shots.”

Before a back-and-forth second half, Hyde threatened to run away in the second quarter. The Phoenix went on an 8-1 run and Mohamed, who finished with 26 points, scored six in the quarter as Hyde took an 11-point lead.

West then scored nine straight points — four from the free-throw line — as Valley closed within 25-23 at the half.

“Carrington was getting denied and the whole game he works his butt off to get open,” West said. “I guess the looks were there, so if they’re there I’ll take them.”

The teams traded the lead in the third quarter. Miller and Mohamed had eight points each.