It was almost déjà vu for the Maryland men’s soccer team.

The Terps seemed prime to drop their first contest of the season against Wisconsin on Oct. 14, trailing 2-1 with just a few minutes to go. But Maryland rallied to score twice to keep its undefeated season alive.

Tuesday night against Delaware, Maryland trailed 2-1 in the 67th minute. Again, the Terps found the resolve to pull out the victory.

Behind a hat trick from forward Gordon Wild, the No. 1 Terps kept their undefeated season alive in a 3-2 win over the Blue Hens at Ludwig Field for the team’s 11th consecutive victory.

The Terps finished with a perfect home record in the regular season for the first time since 2005, when Maryland won the national championship. With a win or tie against Michigan on Sunday, the Terps will finish the regular season undefeated for the first time since 1968.

“We have a love affair with our fans,” coach Sasho Cirovski said. “We seem to want to make things exciting to keep them coming back. We once again found the resiliency to come back when things got tough. We found the mental strength to put in the game-winner.”

In Maryland’s 2-1 win over Hofstra on Friday, it scored both its goals in the opening 20 minutes. The Terps (14-0-2) got out to another quick start Tuesday, scoring in the fourth minute.

Midfielder Amar Sejdic passed into the box, and Delaware midfielder Carlos Perales tried to clear the ball. Wild got in the way of Perales’ strike before the sophomore kicked the ball into the bottom-left corner of the net.

Delaware tied the game in the 23rd minute, a sequence that started with Perales sending a cross to Blue Hens forward Guillermo Delgado, who entered Tuesday with nine goals, on the left goalpost. Defender Donovan Pines, who was making his second career start for defender Alex Crognale (calf), ran toward the middle of the goal when the cross went up, leaving Delgado open. Delgado headed the ball past goalkeeper Cody Niedermeier.

Maryland had a chance to regain the lead in the 44th minute after forward DJ Reeves got fouled in the box. Wild or Sejdic usually take the Terps’ penalty kicks, but forward George Campbell took his second penalty kick of the season. Goalkeeper Todd Morton blocked it.

Cirovski was upset with Wild, forward Sebastian Elney and midfielder Jake Rozhansky’s effort in the first half, so he sat them for the first 16 minutes of the second half. Delaware (10-6-1) continued its high-pressure defense in the frame, which helped it take the lead in the 73rd minute.

Blue Hens forward Marco Siverio sent a cross down the field to Delgado, who sprinted past Pines and defenders Suli Dainkeh. Niedermeier ran out of goal to alter the ball’s direction, but Delgado regained possession and tapped the ball it into the bottom-right corner.

While on his knees, Niedermeier put his hands behind his head before punching the ground.

The Terps struggled to defend counter attacks earlier this season, and that issue resurfaced Tuesday against a team Cirovski said counters as well as any team in the country. After a five-game shutout streak, the Terps have given up six goals in the past four matches.

“My legs are little heavy and that plays a little bit of a factor,” Williamson said. “But sometimes it’s just us not playing our game. I wouldn’t blame it 100 percent on the physical side. It’s just a little mental. If we get our heads back into the game, we’ll be fine.”

Like they do after every goal they allow, the Terps grouped in a circle on the field. Maryland has scored after 10 of the 11 goals its given up this season entering Tuesday, and it responded again against Delaware.

In the 76th minute, defender Chris Odoi-Atsem sent a cross to Wild in front of goal. The German used his back heel to net his second score of the contest.

“You never want to get scored on, especially that late in a game,” Wild said. “We always find a way to figure it out.”

In the overtime periods, Maryland controlled possession but couldn’t put the Blue Hens away until late. In the 106th minute, Wild had a chance to win the game off a penalty kick. He missed for just the second time this season.

Afterwards, Sejdic hugged him, and Wild’s teammates encouraged him by telling him, “We’re a team.”

Less than one minute later, Wild got redemption. Williamson sent a cross into the box. Wild headed the ball into the back of the net for his Big Ten-leading 14th goal, prompting the 5-foot-10, 172-pound striker to raise his index fingers toward the sky before his teammates barraged him with hugs.

Williamson said it’s a play he and Wild practice all the time.

“To win a game where you miss two penalty kicks against a very good team is a fantastic outcome,” Cirovski said. “It shows toughness and resiliency. That’s what our team is right now.”