SANTA BARBARA, Calif. — When the final whistle blew at Harder Stadium on Friday night, and Maryland men’s soccer players spilled off the bench, one Big Ten redemption story continued while the other came to an unexpected end.

A year removed from losing in the national championship, No. 2-seed Indiana was poised to advance back to the title game as the highest remaining seed in the tournament.

But Terps coach Sasho Cirovski has preached his own team’s redemption opportunities — one for the NCAA quarterfinals loss in 2015, one for the sluggish start to the season and one for the two previous defeats to the Hoosiers.

As defender Donovan Pines attempted a cartwheel after his tap-in goal in the 79th minute, he added another chapter in Maryland soccer lore, advancing the No. 11-seed Terps to the national championship for the first time since 2013.

“I’ve talked about redemption all year, our failures over the last couple of years and trying to get back to playing Maryland soccer,” Cirovski said. “This is a great chapter in the story that we’re writing for this season.”

In mid-October, long before Maryland looked like a squad that could make a deep NCAA tournament run, defender Andrew Gutman scored two goals — one with 18 seconds left in regulation — to secure a 2-1 victory for Indiana. A month later, Maryland was trending upward but still fell short on penalty kicks to the Hoosiers in the Big Ten tournament semifinals.

The Terps reversed both results on Friday in the College Cup, ending the season of a conference foe that, in Cirovski’s words, “had [their] number all year long.” Gutman was held to one shot, and Indiana’s three shots on goal were its fewest since September.

Neither team had conceded a goal since that Nov. 9 semifinal in Westfield, Indiana, including all three games in the NCAA tournament. For most of the first half, neither defense allowed any space for opportunities, which both teams readily accepted.

But on Maryland’s second corner kick of the night in the 37th minute, midfielder Eli Crognale found the right spot to place the ball in between Indiana’s defense. He skipped the cross past defender Chase Gasper, where it fell to midfielder Matt Di Rosa.

The sophomore, less than two minutes after subbing into the game, ripped a shot with his left foot that took a deflection off Cory Thomas, the midfielder who scored the winning penalty kick against the Terps a month ago. The slight misdirection was enough to put the ball past goalkeeper Trey Muse for the go-ahead strike.

“You want to come in and make a contribution, and today I was lucky enough to do it,” Di Rosa said. “To get the goal was the best feeling in the world.”

Maryland, winners of nine straight games when scoring first, went into all-out-defense mode for the remainder of the game. The Terps were required to fend off the nation’s No. 14 scoring offense for more than a half — just like their quarterfinal victory — but they still managed to hold Indiana to its second shutout of the year.

In the 62nd minute, defender Ben Di Rosa helped ensure his brother’s goal turned into the game-winner.

With goalkeeper Dayne St. Clair rushing off his line to confront defender Rece Buckmaster, a cross left the goal gaping. Di Rosa bolted in from the middle of the box, slid in front of the net and narrowly kicked the ball away, preventing midfielder Justin Rennicks from getting a shot off.

St. Clair rushed to the makeshift netminder, clenching his fists and hugging him.

“We talked about before the game being compact. We knew they liked to whip in balls, playing them many times previously,” St. Clair said. “But we really focused this week on on our box defending. It was a full team effort.”

That full effort required Maryland’s attacking players to defend. And late in the second period, after Pines committed his night to neutralizing Indiana’s offense, he made his mark on the other end of the field, too.

After a set piece bounced backward off Hoosiers defender Timmy Mehl’s head, Pines continued running and used all of his 6-foot-5 frame to extend his leg and sneak the game-cementing shot through Muse’s legs.

In the national championship against unseeded Akron on Sunday, the Terps could officially close the book on a season that had originally been dedicated to resetting the program.

“This story’s not complete,” Cirovski said. “We’re certainly not satisfied at this point, so we have one more chapter to write.”