After Marquette’s David Joplin airballed a corner 3 and Stevie Mitchell got an easy putback layup, all hope seemed lost for Maryland men’s basketball.

The Terps were down eight points with 1:07 remaining as fans began to file out of Xfinity Center on Friday. But they miraculously cut that deficit to two with 36 seconds left after a pair of desperation threes and a layup.

Two missed free throws by Kam Jones led to a Rodney Rice rebound and a Marquette foul on the other end. Up to the line went DeShawn Harris-Smith. The sophomore guard — who’s faced plenty of criticism for his shooting struggles during his first 36 collegiate games — had an opportunity to dispel that notion with two shots.

His first shot rimmed out. The second one fell short. Joplin grabbed the defensive rebound and Gillespie fouled him. Harris-Smith buried his head into the stanchion on the other end as realization set in.

Mitchell hit a pair of free throws and Maryland fell to No. 15 Marquette, 78-74. After the final buzzer sounded, Harris-Smith walked across the court and toward the tunnel, a white towel draped over his head and his shoulders slumped.

[Amid offensive struggles, DeShawn Harris-Smith embraces defensive-stopper role]

Harris-Smith had a strong game otherwise, finishing with nine points on 4-for-5 shooting in 29 minutes — all season-highs. But the two attempts that didn’t fall will likely stick with him most.

“I have confidence in him. He was out there for a reason,” coach Kevin Willard said. “That’s part of sports. You don’t make every game-winning shot, you don’t make every game-winning play. You have to learn from it, get back in the gym and just be a big boy.”

Marquette got off to a strong start thanks to Jones, its preseason All-American. He scored eight of the Golden Eagles’ first 10 points. On one of those baskets, the burly guard attacked Julian Reese on a switch and drove to the rim for the score. The Terps switched heavily to start out and often ended possessions with big men on Marquette guards.

Maryland made four of its first eight shot attempts but lacked offensive rhythm early. Players struggled to create penetration and often dribbled into late-shot clock possessions, an issue that persisted the entire first half. Many of Maryland’s baskets were self-created — the team had just two first half assists.

The Terps shot an efficient 15-for-26 from the field — but 10 of those shots came in the paint as they struggled from 3-point range. They shot 25 just percent from beyond the arc in the opening period.

[Maryland men’s basketball hopes press defense becomes part of its identity]

Marquette entered the night ninth in defensive turnover percentage. The Golden Eagles forced four turnovers in the first eight minutes and nine in the first half to aid a sluggish offense.

Ja’Kobi Gillespie and Derik Queen carried the load with 11 of the Terps’ 15 first-period field goals. They converted Maryland’s last four buckets of the half. The duo remained strong in the second half, combining for 23 of Maryland’s 40 points.

While those two poured in points for Maryland, Jones did it by himself for Marquette. The senior took over down the stretch — he had 12 straight Golden Eagle points at one point — and began to slowly silence the Maryland crowd.

Marquette held a seven-point advantage with 4:44 to go. It held onto that lead until Maryland began to crawl back and get within two points, but the Golden Eagles held on to take the victory.

“This is why you play these early-season tests, you got to see where you’re at,” Willard said. “That’s a good basketball team. Extremely well coached. That’s why I wanted to test these guys early… that was the first time [some of] those guys have played in this building. So the more they’re in there, the more they see it, the more they’re going to grow.”