After the Maryland men’s lacrosse team lost the 2015 NCAA title game to Denver, the Terps overheard the Pioneers celebrating in their locker room.

Coach John Tillman said the moment, which came with his players still in tears, “just kind of ripped [our] heart out.”

Maryland’s overtime defeat to North Carolina in the 2016 championship carried the same sting. As the Tar Heels stormed the field, goalkeeper Kyle Bernlohr lay motionless on his back.

With the pressure of a 42-year title drought intensified by those shortcomings, the Terps leaned on veteran leaders to regroup and avoid another heartbreak. They beat Ohio State, 9-6, at Gillette Stadium on Monday to capture the national championship.

“The past year has been rough,” senior defender Tim Muller said, “but we knew as seniors that we had to … bring it together for us to get this national championship.”

It wasn’t a seamless path to redemption.

When the Terps suffered a second straight defeat on March 18 to unranked Villanova, dropping their record to 4-2, their title pursuit appeared in jeopardy.

Senior defensive midfielder Isaiah Davis-Allen described the postgame locker room as somber, but he insisted the Terps could bounce back. After all, they’d already dealt with two championship game setbacks.

“Most people right now are sad,” Davis-Allen said at the time. “But it’s not a spot our team hasn’t been in before.”

Maryland won the next five games and finished the year with victories in 12 of its final 13 contests. The only loss came against Ohio State, which the Terps then edged for the Big Ten regular-season title, defeated in the Big Ten tournament final and beat in the NCAA championship.

Along the way, senior attackman Matt Rambo etched his name at the forefront of the program’s record book.

With a first-half goal in the Terps’ 12-5 blowout of rival Johns Hopkins, which gave the team its regular-season conference crown, he passed Bobby Boneillo for the program’s all-time points record. His leaping finish in the NCAA semifinals against Denver gave him the squad’s all-time goals mark, moving him in front of Joe Walters.

Overall, Rambo scored 42 goals and provided 45 assists this season to spearhead Maryland’s dynamic senior attacking unit. His play earned him the Tewaaraton Award, given annually to the nation’s top player, on Thursday night.

“It was a great way to end my career, but winning the championship was the best thing that happened to me at Maryland,” Rambo said. “Without my teammates and coaches and staff and alumni, this couldn’t have happened.”

Senior attackmen Colin Heacock and Dylan Maltz combined for 57 conversions and 23 dishes. Their contributions helped the Terps average 12.47 goals per game, the 10th-most in the country and nearly a full score per contest improvement from 2016.

At the other end, Muller and Davis-Allen, both First-Team All Americans, anchored the No. 15 defense in the nation, holding opponents to 8.79 goals per game. In the NCAA tournament, the Terps kept three of the four teams they faced in single digits.

So, when the squad needed a stop in the Final Four, leading Denver by one with under a minute left, it maintained faith in the backline to deliver. The defense didn’t allow a shot, securing the win with its stand.

“We trust our defense,” Heacock said. “On the offensive end we couldn’t do much besides watch, but we [believed they could prevent a goal].”

With red confetti raining down after Maryland’s championship victory, the players walked over to the stands to celebrate with the legion of Terps fans lingering long past the final whistle.

Among the crowd, former players who had once mentored the current crop of seniors — but never cherished a title — offered emotional congratulations.

“It was special,” Heacock said. “Coming in here as freshmen, a lot of those older guys helped us and made us comfortable. So, [it was] kind of what they started. It felt great just to finish it and share that moment with them.”