Maryland’s defense kept Saturday’s contest against Michigan State close for most of the game, even as the Terps’ offense struggled.

When fifth-year guard Jahmir Young blew by his defender and dropped in a layup with about seven minutes to go, he gave Maryland its first lead of the night in a defensive battle that appeared could come down to the wire.

But the Spartans quickly reclaimed the lead and took control of the game. Michigan State made six of its next eight shots, scored 12 unanswered points and claimed its second win over Maryland in two weeks.

The Terps fell to the Spartans, 63-54, at the Breslin Center on Saturday. Young scored 31 for Maryland, but his supporting cast was quiet. The Terps shot just 30.9 percent from the field and 23.3 percent from three in their loss.

Despite holding Michigan State more than 10 points under its scoring average on the season, the Terps’ defense didn’t hold up in the final minutes of the game and their stagnant offense never came to life.

“We just got really stagnant on the offensive end,” Maryland coach Kevin Willard said. “… Those guys battled. We got it back, took the lead 43-42, we had a wide-open three when we’re down one. But then the fatigue came in.”

Maryland faced a tough blow early when forward Julian Reese was called for his second foul less than three minutes into the game. His foul trouble limited him to just two points in 14 minutes on Saturday, and his absence disrupted the Terps’ offense.

[After early season struggles, Maryland men’s basketball has found its identity]

Maryland (13-9, 5-6 Big Ten) got off to a slow start and trailed, 14-5, after about seven minutes of play. All five points came from forward Donta Scott, who notched the only two makes on the Terps’ first 13 attempts to start the game.

After Scott sank his second three of the night, Young scored his first of the game to cut into the Spartans’ lead.

Reese picked up his third foul with just over seven minutes to go in the first half as the Terps trailed by three points.

“The fouls on [Reese] really changed the game,” Willard said.

Young and Scott took on an even larger role as Reese sat for the rest of the half. The pair of fifth-year seniors combined for 23 of Maryland’s 27 first-half points. The other four came from Jordan Geronimo, who also tallied three blocks for the Terps in the opening 20 minutes.

Maryland shot just 10-for-32 from the field and 5-for-17 from three in the opening half, but stayed in the game thanks to solid defense. The Terps entered the break trailing Michigan State (14-8, 6-5 Big Ten), 31-27. Guard Tyson Walker led the Spartans with 12 points in the first half.

It only took eight seconds of second-half play for Reese to pick up his fourth foul, as the junior was called for an illegal screen.

[Maryland men’s basketball’s heralded freshmen got a bright moment in a challenging year]

With Reese out and Maryland’s defense continuing to cause problems for Michigan State, neither team found an offensive rhythm after halftime. The Terps and Spartans combined to shoot just 4-for-23 through nine minutes in the second half.

Michigan State guard Jaden Akins hit the first three-pointer of the half with about nine minutes remaining before Young answered with a triple of his own on the next possession.

Young averaged 28.6 points per game in the Terps’ previous five road games and carried that success into East Lansing. A blow-by and layup from Young with about seven minutes left in the game gave Maryland its first lead of the game, but it was short-lived as the Spartans took it back on the ensuing play.

Young shot 9-for-22 in his 31-point outing and made all nine of his free throw attempts.

After trading successful trips to the free-throw line, Michigan State went on an 8-0 run in just 59 seconds to take a nine-point lead with just over four minutes to go.

The Spartans would add four more points to their lead before the Terps scored again — another Young three that cut Maryland’s deficit to 10.

Ultimately, that lead was too much to overcome, and the Terps fell back under .500 in Big Ten play. Maryland heads back home to host Rutgers at the Xfinity Center on Tuesday.

“Have to give them credit,” Willard said. “They are a physical, defensive team with an unbelievable home-court advantage.”