Up until its game against Providence in the second round of the NCAA tournament Sunday evening, the Maryland men’s soccer team relied on its resilience.

The Terps had scored after 17 of the 19 goals it surrendered entering Sunday, but they were on the opposite side of the comeback heroics against the Friars.

Facing a 4-1 deficit in the 70th minute, Providence scored four unanswered goals to down the No. 1-seed Terps, 5-4. Maryland couldn’t net a late equalizer as it had in past matches, resulting in the season ending with its first loss of the year.

“We’ve had a tendency at times this year to let teams back into games,” coach Sasho Cirovski said. “That allowed them to have some space and a little bit of confidence. We need to manage the game better. We need to close things out. We need to be simpler.”

Before Sunday, Maryland trailed four times in the final 10 minutes of games. But every time the Terps faced a deficit, they had erased it by the contest’s end.

It was different against Providence.

Maryland scored twice nine minutes into the second half to take a 4-1 lead. Cirovski was happy with his team’s defense until the final 20 minutes, when Maryland struggled to clear the ball.

Providence notched two goals in the 70th minute, cutting the Terps’ lead to 4-3. About five minutes later, Friars defender Steven Kilday tied the match.

“We knew maybe if we get a goal, maybe they start to shake a little bit,” Providence midfielder Julian Gressel said. “They did a little bit when we scored the second one. We just kept fighting and putting them under pressure. We were a little fortunate at the end too. We just found a way.”

Midfielder Amar Sejdic said Maryland remained calm like it had this season. The Terps continued to find looks in the second half, outshooting Providence, 12-8, in the frame, but Cirovski’s squad couldn’t finish with its season on the brink.

In the 82nd minute, Friars defender Joao Serrano scored off a corner kick to take the lead ­— the first time Maryland has given up a score directly off a corner this season. The Friars had seen the 12 one-goal victories Maryland earned this year, but they weren’t intimidated.

In Providence’s huddle after tying the game, Friars defender Nick Sailor said the team talked about not giving up, the same principles the Terps discussed in their huddles minutes from defeat earlier this season.

Goalkeeper Cody Niedermeier acknowledged Thursday how unpredictable the postseason results can be. After all, he said, one off outing can end a season.

Sunday, 20 minutes of underperformance cut the Terps’ national title pursuit short.

“When you’re down 4-1, against a team like Maryland, I don’t think you expect to come back and tie it 4-4 within five minutes,” Providence coach Craig Stewart said. “It was like, ‘Holy … we have a game.’ We believed in ourselves.”