Maryland volleyball coach Adam Hughes knew an aggressive Michigan State team would test his squad’s ability to handle serves cleanly.

Still, the Terps’ coach said his team had improved in that area following an Oct. 28 sweep of Iowa. Maryland’s display on Friday in East Lansing suggested otherwise.

The Terps surrendered eight aces throughout the first two sets against the Spartans, who rallied to win both of those frames before capitalizing on a costly Maryland service error to scratch across a close win in the third stanza. Serving struggles and a pedestrian offense that registered just 26 kills doomed the Terps in their 3-0 loss to Michigan State.

“It just didn’t feel like we had a lot of confidence tonight, ” Hughes said. “It was kind of surprising. We didn’t serve very well … some of our better servers didn’t look like they had a ton of confidence going back there driving some balls.”

Erin Morrissey supplied the lone ace for Maryland (15-10, 5-8 Big Ten), which scattered 10 service errors and produced putaways on just over a quarter of its attacks.

The Terps entered the regular season’s final month fighting to stay in contention for a potential NCAA tournament berth — Friday’s setback delivered a considerable blow to Maryland’s chances. The Terps’ final seven games include matchups against conference heavyweights Wisconsin and Purdue, both of which have already defeated Maryland once this season.

[Waka Flocka, SZA and Coldplay: Maryland volleyball’s eclectic pregame playlist]

The Terps’ sharp attack pierced the Spartans with five kills in the first 14 points before a slew of errors wiped away Maryland’s early edge.

The trouble started at the endline when Sydney Dowler’s serve sailed out of bounds, which swung the ball back to Michigan State (15-9, 7-6 Big Ten) with it behind 8-7. After finding success attacking the middle of the court, the Terps suddenly struggled to find creases and shanked four spikes amid a Spartan surge that vaulted the home squad ahead for good in the set.

Evie Doezema smothered Laila Ivey’s shot to cap a string of seven straight Michigan State points that put the Spartans ahead 13-8. Doezema then stymied Sam Csire at the net to touch up an 11-1 run that featured just four Michigan State kills.

Maryland’s back row mishandled consecutive serves later in the set as the Spartans sprinted to a 25-14 win.

“We kind of just got into our own heads,” senior libero Lilly Gunter said. “They did have a really great topspin server, but I think the challenge was just trying to stay confident back there.”

The Terps again raced out to an early lead in the second frame — Eva Rohrbach had a kill and a pair of blocks to supply half of Maryland’s 6-0 lead.

[Maryland volleyball shined in its few appearances on national TV]

But the visitors ran out of breath just as quickly. The Terps weathered a Taylah Holdem ace to build a 9-3 lead but looked outmatched trying to corral offerings from Michigan State’s Rachel Muisenga and Karolina Staniszewska.

The duo ambushed Maryland with five aces throughout the Spartans’ second mid-set scoring spree. This time, it was a 13-1 onslaught that flipped the Terps’ six-point cushion into a 16-10 deficit. Maryland’s efficient offense squared up 11 kills without misfiring out of bounds, but persistent serving struggles limited its chances to attack.

“Even when we weren’t getting aced, we were passing pretty poorly,” Hughes said. “ … [We were] kind of in scramble mode trying to play from behind.”

The Terps couldn’t mount any momentum from the endline either. Maryland was out-aced 6-0 throughout a seven-point loss that left it a set away from being swept.

The Terps avoided another mid-set meltdown in the third frame when they countered four straight Michigan State points with a 5-1 run to knot the stanza at 20-20. But yet another service error by Maryland kicked off a four-point Spartan surge that left the Terps a point away from the sweep.

Hughes’ squad fought back, but Aliyah Moore’s sixth kill of the match dealt Maryland a costly defeat amid its narrowing postseason push.

“It’s disappointing because it’s not what we looked like all week in practice,” Hughes said. “But sometimes, that can happen.”