INDIANAPOLIS (AP) — Coach Mark Turgeon thought Maryland played like an NCAA tourney team Saturday.

It defended hard, refused to back down and had a chance to upset No. 2 Michigan State in the closing seconds. The Terrapins came up just short.

Moments after Melo Trimble missed a layup that would have given No. 18 Maryland the lead, Denzel Valentine grabbed the rebound, drew a foul and made two free throws with 0.8 seconds left to give the Spartans a 64-61 victory.

"We learned a lot about ourselves today. That's the best we've guarded in a long time," Turgeon said. "But at the end, the last three minutes, they were able to make one or two more plays than we could."

Robert Carter Jr. led the Terrapins (25-8) with 18 points and nine rebounds. Trimble finished with 11 points.

But it was Trimble who could have won it.

He drove for a layup to make it 62-61 with 14.7 seconds left and when Valentine missed the front end of a one-and-one, Trimble got the ball back and drove in again, missing the layup on a no-call. Then after Valentine's final free throws, Trimble barely got the ball out of his hands on a desperation heave from 55 feet that was ruled to come after the buzzer and was nearly another foul.

"I was very surprised because he clearly bumped into me and I tried to force one up," Trimble said. "We didn't get the call, but, you know, it happens."

Valentine finished with 18 points, 10 assists and seven rebounds falling just short, for the second straight day, of becoming the first player in tourney history with a triple-double.

He'll have one more try in Sunday's title game against No. 13 Purdue.

"That was a weird game for Denzel Valentine and all he did was 18, 10 and seven," coach Tom Izzo said. "I guess I'm getting like fans, spoiled."

After explaining Friday that the Spartans (27-5) were angry about finishing second in the regular season, Valentine has them playing like champs. They've won 12 out of 13 as they chase a record-tying fifth tourney title.

Even more impressive is how the Spartans are winning.

One day after Maryland (25-8) scored a tourney-record 97 points, Michigan State held the Terrapins 25 points below their season average and allowed only two baskets over the last 10½ minutes — Trimble's 3 with 10:25 left that tied the score at 53 and his late layup.

Over the final 35½ minutes, Michigan State trailed for a total of 19 seconds in this rough-and-tumble game.

Maryland's Jake Layman got hit in the face on the first basket. No foul was called.

A couple of possessions later, Layman and Eron Harris each picked up technical fouls as Rasheed Sulaimon and Valentine had words near midcourt. A few minutes later, Turgeon was given a bench warning.

Less than 12 minutes into the game, Trimble got hit in the face with the ball on a Michigan State pass, forcing him to briefly leave. And then, with 4:15 left in the first half, Turgeon drew a technical.

None of it bothered the Spartans, who took an 11-10 lead and didn't allow Maryland to tie the score until Trimble's 3 or take the lead until Carter made two free throws with 6:55 to go. Deyonta Davis answered with a dunk on the next possession to give Michigan State a 58-57 lead and the Spartans never trailed again.

SEWING THE SEEDS

Michigan State has made a pretty strong case for a No. 1 seed this week. After blowing out Ohio State by 27, they beat Maryland for the second time this year. So what more could the selection committee want from the Big Ten's regular-season runners-up? Perhaps a tourney title.

TOUGH TIME

In addition to getting hit in the face and missing a go-ahead layup at the end, Trimble missed his first nine shots. He finished 2 of 15 from the field and 1 of 7 from beyond the arc, with three rebounds, two assists and one steal.

FREEBIES

Michigan State made 14 of 15 free-throw attempts Saturday. But only two players attempted them. Matt Costello made all six. Valentine was 8 of 9.

TIP-INS

Maryland: Has lost three straight to Michigan State. ... Layman finished with nine points and moved into the top 20 on Maryland's career scoring list. ... Carter needs 10 points become the fourth player on his team to join the 1,000-point club.

Michigan State: Has won four of its last five semifinal games in the Big Ten Tourney. ... The Spartans made eight 3s on Saturday, giving them (302) this season. They need six to break the school record (307), set two years ago.

UP NEXT

Maryland: Awaits NCAA Tournament pairings.

Michigan St: Faces No. 13 Purdue in Big Ten Tournament championship game Sunday.