After the Maryland men’s soccer team squandered a 1-0 lead against Wisconsin in its seventh game of the season, coach Sasho Cirovski sent his players directly to the locker room.

The Terps typically stay on the field for a postgame discussion — even after losses — but not this time. Cirovski was upset, and understandably so. After leading for almost the entire game, his team conceded the equalizer with 53 seconds left and lost in double-overtime.

Against the Badgers, Maryland seemed in control and appeared to not sense danger. It was similar to the previous two seasons, both of which started with lengthy undefeated streaks and ended with first-game exits in the NCAA tournament.

The learning moment against Wisconsin was an inflection point. Since that game, the Terps have gone 9-3-2, shutting out their first three opponents in the NCAA tournament and advancing to the College Cup.

“It’s tough to teach young men what’s wrong when they’re winning,” Cirovski said. “That really hurt us. This year, through some of the losses and the ties, we were able to really figure out what to strengthen.”

[Read more: Donovan Pines shut down Kentucky’s best attacker in Maryland soccer’s Elite Eight win]

A defeat to a Badgers team that eventually missed out on the NCAA tournament exposed flaws that might not have been revealed in previous seasons. It was already Maryland’s third loss of the season, providing an ample sample size for the squad to identify imperfections.

The inability to play hard all 90 minutes and put an inferior team away were two key takeaways the Terps took out of that game. After forward Paul Bin’s seventh-minute goal, they missed on their final 11 shots, including three attempts in the first overtime period.

“That was one of the games that definitely was an eye-opener for all of us,” Bin said. “It changed our whole perspective as a team on how we should close out games, how we should play. Sash wasn’t the happiest bunny after that game, but deservedly so.”

[Read more: In his senior season, Andrew Samuels is finally a captain for Maryland men’s soccer]

Despite conceding a game-winning goal in the 90th minute five games later against Indiana — its national semifinal opponent on Friday — Maryland learned the importance of a short memory and scoring first.

Bin scored an equalizer in the 57th minute in that meeting with the Hoosiers, sparking a celebration, but the Terps’ euphoria was outmatched by Indiana with less than 20 seconds on the clock. So after storming the field in Lexington last weekend, Maryland quickly moved on.

“We definitely enjoyed what we did and we celebrated that,” forward Sebastian Elney said. “But as soon as we got back to the practice field on Sunday, it was narrowing down and focusing up on our next opponent and how we’re going to take care of them.”

Maryland didn’t score first in that Indiana game. Since the loss to Wisconsin, the Terps are 9-0 when scoring first, and in each of their first three NCAA tournament games, their first shot on goal has found the net.

Against NC State, midfielder Amar Sejdic took advantage of a goalkeeper miscue in the 11th minute. Against Duke, midfielder William James Herve scored a scissor kick in the 24th minute. And against Kentucky, Elney’s finish in the 29th minute wound up being the lone goal of the game.

“It’s good that our offense is kicking in and banging in goals because we know we have probably the best defenders in the country behind us,” Bin said. “Scoring that first goal definitely means a lot.”

When Elney put the Terps up against the Wildcats in the first half, goalkeeper Dayne St. Clair knew that would be the game-winner. Given the strength of Maryland’s defense, one goal was all the team needed.

Facing the Badgers, the Terps scored first and held a lead late, but couldn’t turn it into a win. Cirovski hoped the pain from that game could be harvested into something positive.

Now, as the Terps prepare for their first College Cup appearance in five years, having upset numerous ranked opponents along the way, they highlight that loss as their most important game of the season — because it showed them what is required to reach this stage.

“It just goes to show you have to fight to the very last second of the game,” defender Chase Gasper said. “We conceded goals in the final minutes of the games. You have to be 100 percent focused until the final whistle is blown, and you cannot concede.”