The No. 1 Maryland men’s soccer team has endured multiple scares this year in its quest for an undefeated season. But those didn’t match the pressure Michigan presented the Terps on Sunday.

Maryland trailed 2-0 in the 65th minute, the largest deficit the team has faced this year. Yet as they have all season, the Terps found the resilience to respond, even without four of their best players available.

After forward Gordon Wild scored in the 66th minute, defender Chris Odoi-Atsem netted one with 61 seconds remaining in regulation to send the match to overtime. Defender Suli Dainkeh’s game-winner in the 109th minute left his teammates chasing him around the field in Ann Arbor, Michigan.

With its 3-2 victory over the Wolverines, Maryland extended its win streak to 12 games and completed its first undefeated season since 1968.

“I’m bursting with pride with the way that our boys came through today,” coach Sasho Cirovski said. “To get behind against a very determined Michigan team and find the resolve, the character and the quality to come back and get this victory to finish off a historic season is incredible.”

Four of Maryland’s most dangerous weapons weren’t available Sunday. Forwards Sebastian Elney and DJ Reeves and midfielder Eryk Williamson all had food poisoning, while midfielder Amar Sejdic sat out with an injury. Without them on the field, the Terps (15-0-2, 7-0-1 Big Ten) presented a weaker challenge in the attacking third, and the Wolverines exploited their defense early.

Michigan forward Francis Atuahene attempted a shot with three defenders circled around him in the sixth minute, and the ball smacked off defender Alex Crognale’s feet. It bounced into the middle of the box to Wolverines midfielder Robbie Mertz, who was open. As goalkeeper Cody Niedermeier ran out of goal, Mertz kicked the ball past him.

Then in the 19th minute, forward Jack Hallahan attempted a shot from the top of the box. With two players standing in front of him, Niedermeier lost track of the ball as it settled into the bottom-left corner of the net. The Michigan players celebrated by hugging Hallahan, while Niedermeier spread out his arms in frustration before rolling onto his back.

After a five-game shutout streak, the Terps have allowed a combined eight goals in the past five contests.

“The two goals we gave up, I felt one was an opportunistic goal by Michigan, and the second one was a preventable goal,” Cirovski said. “These things happen in soccer.”

The Wolverines exerted energy similar to that of the Terps’ past foes in pursuit of a No. 1 upset. They committed 11 fouls in the first half, and the teams jawed with one another on multiple occasions.

Though Maryland trailed at halftime for just the second time this season, Cirovski was happy with his team’s performance. Recently, the veteran coach has yelled at his squad at halftime to raise its intensity. Sunday, he was calm, encouraging his team to keep pushing.

“The two goals we gave up, nobody panicked, not the coaches, not the players,” Cirovski said. “We had to deal with some adversity being down 2-0 on the road. We found another way to bounce back.”

Maryland scored after 12 of the 13 goals it had surrendered entering Sunday, and it responded again against Michigan (3-10-4, 1-6-1).

Forward George Campbell’s shot hit defender Andre Morris’ left hand in the box in the 66th minute. Wolverines goalkeeper Evan Louro held the ball in his hands while complaining to the referees. Wild, who missed a penalty kick Tuesday, ripped the ball out of Louro’s hands before scoring his Big Ten-leading 15th goal on a penalty kick.

Maryland, who entered Sunday with the most points per game in the country (7.65), attempted 27 shots on the match. But without four of their stars, who’ve combined for 46 points, the Terps struggled to convert. That changed in the 89th minute. Wild passed to Odoi-Atsem in front of goal. The senior dove to kick the ball past Louro for his first tally of the season.

In the 103rd minute, midfielder Jake Rozhansky’s shot hit the top crossbar and bounced near the goal line. The shot went under video review and was called a no-goal, prompting Cirovski to yell at the officials. But it didn’t matter. About six minutes later, Wild’s shot was blocked, and the ball rolled to Dainkeh.

The senior struck the ball for his first career goal. While the Terps celebrated, some Wolverines players sat on the field with their jerseys over their heads, the latest victims of Maryland’s resilience.

“We had a feeling we were going to get on the board in the second half and have a chance to win,” Cirovski said. “Certainly we came through.”