HEMPSTEAD, N.Y. — What had once been a comfortable five-goal lead evaporated, a seemingly secure path toward the final four in doubt, when Virginia attackman Michael Kraus’ shot was deemed a score despite clanging off the post.

Once Anthony DeMaio slotted home Maryland men’s lacrosse’s 12th goal Saturday to establish a 12-7 edge in the fourth quarter, the Terps chose to work the clock when they had possession.

The conservative approach was meant to push Maryland closer to a berth in the NCAA tournament semifinal in Philadelphia. Instead, it pushed Virginia into attack mode.

So as goal after goal found the back of the net late in the fourth quarter for the Cavaliers, the contest began to turn. Ultimately, it was Kraus’ controversial tally that extended the game into an overtime session, where Maryland’s season ended in stunning fashion with a 13-12 loss.

“As a coach, those are always things you reflect back on,” coach John Tillman said about the approach. “Our kids did everything they needed to do. I need to do a better job in that moment, and managing some of the things of the game.”

When Kraus’ shot caromed off the crossbar and all the way to midfield, both teams gave chase. It was all for naught, though, as Virginia players broke out in a delayed celebration when the official extended both hands into the air, signifying a goal had been scored.

As the Cavaliers rejoiced over the score that completed an unlikely comeback, Tillman and his team were dumbfounded. Coaches lobbied the officials, and players stood with their hands in the air.

“It’s kind of out of our control,” midfielder Bubba Fairman said. “It’s tough to look at it when you’re on the sideline [and] wonder whether or not that went in. But at the end of the day, I think the attitude on the sideline was like ‘let’s go get one back.’”

Maryland had 1:14 left in the period to ensure the officials’ decision didn’t define their ultimate fate. But just as the Terps struggled to secure possession during Virginia’s unlikely comeback, a faceoff win again eluded the squad to end regulation.

Maintaining a 12-8 lead with 3:53 remaining, Maryland appeared comfortable as midfielder Kyle Long heaved the ball into the corner with the shot clock about to expire, willingly surrendering the possession without a shot. It marked the final time Tillman’s squad had the ball on that side of the field.

Twenty-eight seconds after the turnover, Virginia midfielder Ryan Conrad fired a right-handed shot from the wing to initiate the onslaught.

Faceoff specialist Grayson Sallade won the ensuing draw, and attackman Ian Laviano added the Cavaliers’ second goal in 20 seconds to make the score 12-10. Before Laviano’s shot found the back of the net, Terps midfielder Roman Puglise was penalized for unnecessary roughness, which gave Virginia an extra-man opportunity to extend its run.

“Ian scores that goal, and there’s a penalty, to bring us within two with three minutes left, I’m like, ‘This is happening,’” Cavaliers coach Lars Tiffany recalled.

Conrad converted on the man-up goal to improve the likelihood his coach’s vision would come to fruition.

Despite losing its fifth consecutive faceoff, Maryland still had a chance to end the Cavaliers’ comeback bid one goal short. The defense had come up with a stop, as midfielder Alex Smith scooped a ground ball off a turnover.

But the Terps still had to get the ball past midfield against a team that entered the game allowing its opponent to clear successfully only 70 percent of the time.

Defender Thomas O’Connell caught the pass in the middle, searching for an escape while under duress. But attackman Matt Moore pursued O’Connell and forced the ball free with a trail check to his stick.

Less than 20 seconds later, Kraus fired his lefty shot toward the cage that the official perceived as the tying goal.

“We didn’t realize it was a controversy in our game until after the game,” Tiffany said. “We just don’t have those angles and we’re not looking at that.”

Virginia took the opening faceoff in overtime, and Moore scored 45 seconds later to propel itself into the semifinal and end the Terps’ season short of the final four for the first time since 2013.

The contested call on Kraus’ score was made possible with the Cavaliers’ stronghold on possession in the final four minutes of regulation. Virginia captured all four faceoffs in that span and outshot Maryland 9-0.

Not only did it give the attack a chance to score, it kept the Terps’ offense — which had two players who scored four times in DeMaio and attackman Jared Bernhardt — from having a chance to find the tally that could have cemented the Terps’ spot in the championship weekend.

“We knew Virginia would make a run,” Tillman said. “You hope that, alright, we can get back, we can get in, get some stops — at least a couple. Even with that, get a possession off the faceoff, groundball, whatever it may be. And a lot of those things just didn’t happen.”