All Hakim Hart could do was smile.

It was for good reason. Maryland men’s basketball was locked in a tight contest with Michigan State on Sunday afternoon. While the Terps had kept the Spartans at bay for much of the game, Tom Izzo’s squad was rising, down nine with just over five minutes left.

That’s when Hart sprung into action. The sophomore guard fielded a pass from Donta Scott, taking aim a few feet beyond the perimeter. In one smooth motion, he fired, rising above Joshua Langford’s late contest to get an open sight of the basket.

And when his shot fluttered the nylon, Hart beamed.

It’s a sight Hart has gotten used to. The Philadelphia native has always been confident, he said. His role in coach Mark Turgeon’s squad hasn’t always reflected that.

But now, Hart’s a starter. And in the past two games, he’s been playing like one, making big plays on both ends of the floor to help push Maryland to season-defining wins.

“I’ve always been a confident player,” Hart said, “but these last two games just boost my confidence level even more.”

[With the help of a fast start, Maryland men’s basketball surged past Michigan State]

That heightened confidence has been on display for much of the season. Hart’s development — from sparingly played benchwarmer to big-time contributor — was fueled by an offseason like no other. Away from Xfinity Center’s glare, Hart’s all-around game began to take shape.

And Hart marked that improvement with a host of glittering performances. He racked up a career-high 32 points against Saint Peter’s on Dec. 4, filling in admirably for guard Aaron Wiggins, who was out with an injury.

Against then-No. 12 Illinois, Hart was even more valuable. With 1:18 left, he hit a triple, giving the Terps the lead — one they wouldn’t give up. It was a shot that reflected Hart’s penchant for drilling big shots late in games.

“I think I just got big-time genes, I guess,” Hart said.

Hart’s influence began to wane toward the end of January, though. The sophomore failed to hit double figures in nine straight games, struggling to find consistency with his scoring.

Still, Hart was finding ways to affect the game. He’s been a key cog in Turgeon’s defense, harassing guards alongside Maryland’s defensive talisman, Darryl Morsell. His ball-handling and playmaking ability has given Aaron Wiggins and Eric Ayala license to create shots for themselves.

But it was his shooting gifts — coupled with that eye for a pass — that brought Hart to College Park.

“He’s a big-time shooter. We recruited him because of his shooting, and we recruited him because he’s a great passer,” Turgeon said.

[Stout defense carries Maryland men’s basketball past Michigan State, 73-55]

And coming off of a zero-point, 0-for-5 showing against Nebraska on Feb. 16, Hart had a point to prove against Michigan State.

He started brightly, calmly sinking a triple to put the Terps up eight with just about three minutes gone.

Hart’s impact was clear throughout the day, even when his scoring slowed. The sophomore was a focal point on the perimeter, swinging the ball out to open shooters in Ayala, Wiggins and Morsell.

“He’s done a really good job of embracing every position that he’s been in and just trying to do whatever it takes to help our team win,” Wiggins said.

Yet when Turgeon’s squad needed him the most, it was Hart’s scoring touch that stood out. Hart knifed to the cup for a dunk with 12:29 left, putting Maryland up nine. Three minutes later, he did it again. This time, though, he opted for a softer approach, delicately laying the ball in.

And then, there was his triple. Hart flexed three fingers as the ball fell through. On the other end of the floor, his yellow-clad teammates erupted.

The Spartans would never get within 10. And as the Terps cruised to yet another impressive victory, one thing was clear.

Hart was back in his bag. With tournament play on the horizon, that’s only a good thing.