SUDBURY — In a matter of a few minutes, an exhilarating feeling of elation for the Dracut High School boys soccer team was replaced by utter heartbreak.

Wayland 3, Dracut 2, OT

The second-seeded Middies were victimized by a controversial ending that put a damper on their brilliantly played classic against No. 6 Wayland on Wednesday night.

The Warriors netted the game-winning goal off the foot of sophomore Zach Campana 91 seconds into overtime after what looked to be a hand ball by the Wayland player. After some confusion and brief deliberation by the referees, the hand ball was ruled unintentional because the player’s hand was down by his side and Wayland escaped with a 3-2 victory in the Division 3 North semifinal.

The referee on the far side put up the flag as if to signify a handball, which caused brief hesitation by the Dracut players. But the whistle never blew and Campana buried the shot for the winner. The Dracut sideline was visibly upset and demanded clarification. The refs then huddled and stuck with the goal call to end the sudden death period.

“It looked like a hand ball to me,” said Dracut head coach Ryan Keefe, whose team finished the season 14-3-3. “They had also just called a hand ball on us, and they missed a hand ball on them before that hand ball. Neither one was called, and the referee on the other side had his flag up and was pointing to his hand, and then they denied it.

“It stinks that it comes down to that.”

In the final minute of regulation stoppage time, Middies’ senior defender Edwin Bonilla collected the ball in a scrum in front of the Wayland net and drilled a shot off the far post and in to tie the game at 2-2. The large contingent of Dracut fans who made the trip erupted in celebration, as did the team on the field.

“I’m just so proud of the guys and the way they fought back until the last seconds,” said Keefe.

On the winner, Wayland (12-3-4) head coach David Gavron was just as confused as anyone at first.

“All I saw was the ball go into the net and the boys running onto the field,” said Gavron. “Right away when I saw the far lineman had his flag up I went, ‘No!’ The explanation was that it wasn’t handling, he wasn’t handling the ball. It hit his arm, but it wasn’t handling.

“(Dracut) is an incredible, incredible team. They’re a phenomenal team, they worked hard and it’s gut-wrenching to think about what they’re experiencing on that side. Hopefully they’ll rebound and be strong again next year.”

The Middies took a 1-0 lead with 16:30 left in the first half when junior Brendan Davis headed in a perfect cross from senior James Fazio.

Wayland converted twice in a span of less than two minutes to go ahead. Senior Jack Dretler made a long run and beat Dracut goalkeeper Graham Shank with 5:03 left in the first half. Dretler later took a perfect free kick feed from senior Ben Johnson and flicked it in with his head for a 2-1 advantage with 3:19 remaining in the first.

Follow Matt Langone on Twitter @MattLangone