NEW YORK -- After trailing for nearly the entire game, Stanford had pulled within one point with 9 seconds to go.

But sophomore guard Nik Stauskas, Michigan's leading scorer entering the night, coolly sank two foul shots to extend his team's advantage to three, and the Wolverines hung on to defeat Stanford 68-65 on Saturday night at the Barclays Center.

The Cardinal (8-3) were tough in defeat, keeping the game close even after center Stefan Nastic, who matched his season high of 14 points, fouled out with 5:24 remaining. Chasson Randle put Stanford on his back the rest of the way, scoring 12 of the team's final 15 points, on his way to 18 overall. But his desperation, last-second three-point try was off the mark, and the Cardinal came up short.

Stanford coach Johnny Dawkins was pleased by the effort, but recognized that his squad couldn't make the big play it needed to break through.

"I thought that we had moments," Dawkins said. "At the end of the game we did a very good job making a run to close it to one possession. And we just could never get over the hump."

The Wolverines (7-4) were able to validate their impressive effort against No. 1 Arizona on Dec. 14. Their 72-70 loss to the top-ranked Wildcats gave Michigan fans reason to believe their squad could compete with anybody. The victory against Stanford provides even more evidence on that front.

Stanford came into the contest off an impressive performance of its own - defeating No. 10 Connecticut 53-51 on Wednesday. But the Cardinal couldn't quite capitalize on their bid to return to Palo Alto with two big wins over prominent programs. Still, Dawkins, despite being down about the loss, was proud of his group.

"Our kids have a will to win. They've always had that. They really compete to the last minute," he said. "But tonight, we just didn't have enough to overcome the lead that they had."