The Maryland women’s soccer team was outplayed for much of its Sunday game at Navy.

But with just seconds remaining in the second overtime period, midfielder Sydney Staier ran onto the end of a through ball and rolled a would-be winner toward the far post.

Instead, the ball trickled wide. The final whistle sounded on a 0-0 draw, concluding the contest with a heart-wrenching near-miss for Maryland, flipping the script after Navy had a 90th-minute chance erased by an offside call.

“It was crazy,” said coach Ray Leone. “You don’t see that very often when both teams get a chance to win the game [at the last second].”

When goalkeeper Rachel Egyed deflected a well-placed Navy corner into the path of a Midshipmen player midway through the first half, it seemed the Midshipmen were going to break the scoreless draw.

However, the Terps (2-1-1) defense, as they did time and time again against the Midshipmen on Sunday, came up big to preserve the shut out. The backline stood tall in the goalmouth midway through the first half, clearing the potential go-ahead chance for a Navy side (2-1-1) that dominated the Terps during much of that period.

After an early Maryland scoring opportunity by midfielder Hope Lewandoski in the first five minutes, the Midshipmen dominated possession in the early stages.

The Terps struggled to connect passes in the midfield, frequently turning the ball over and putting pressure on their own defense. Maryland withheld the onslaught, though, holding the scoreline level despite being outshot 8-2 in the first half.

But only two of Navy’s shots were on target, and Egyed was up to the challenge on both. Maryland defenders continually cleared the Midshipmen’s dangerous crosses into the box.

“[The defense] was absolutely fantastic tonight,” said Leone. “Their commitment to defend together was the best we’ve done so far… They locked down for nearly 90 minutes against a really good team.”

In the early stages of the season, Egyed and fellow goalkeeper Erin Seppi have shared the duties in net for the Terps, with both goalies playing one half in each of their four games coming into Sunday’s contest against Navy.

After Egyed held Navy scoreless in the first half — with help of her defense’s goal line stand midway through the first period — Egyed played a full game for the first time in 2018 and earned her first cleansheet of the campaign.

“Rachel was really confident and really commanded the box,” said Leone. “She was extremely strong in goal and showed — hey, this is what a fifth-year senior looks like.”

The Terps didn’t muster another shot attempt until the 30th minute, a try at the top of the box that flew wide right from forward Mikayla Dayes. And minutes after halftime, forward Alyssa Poarch supplied the Terps’ lone shot of the second period.

The team’s offense played better in the second half, controlling the ball in the midfield with more success than earlier, but were still outshot 5-1 during the period. It was enough to force overtime, when the Terps had more success in creating chances.

Midfielder Anissa Mose missed wide on two opportunities before forward Jarena Harmon beat Navy goalkeeper Sydney Fortson but hit the top of the bar. The Terps doubled their shot total from regulation in the first 10-minute overtime period.

Then, with mere seconds to play, Staeir had one last look, but missed just wide.