With the Terps running out in transition and Ian Martinez streaking toward the basket, Jahmir Young knew all he had to do was loft up a pass.

Martinez sprinted forward before he threw down a two-handed alley-oop dunk to an Xfinity Center roar against Penn State, an actualization of the energy coach Kevin Willard said the guard brings off of the bench.

The junior flashed his electric slams and defensive straps throughout his first year with the Terps, but those sights became an even more common feature of his appearances this season as the Utah transfer has found his role as Maryland men’s basketball’s spark plug.

“I take a lot of pride in just coming in and lifting the team up,” Martinez said. “I think my energy has a lot to do with what I have to bring to the table. I think it’s just a really big boost for the team, especially in times when they need it the most.”

That injection of zeal off of the bench has helped Martinez become a key part of Willard’s rotation this year after the guard’s tumultuous first season with the Terps.

[Maryland men’s basketball uses efficient offense to ease past Minnesota, 88-70]

Martinez struggled to adjust to a sophomore year in which Maryland itself went through a lot of change and labored to its first losing regular season since 1993. Former coach Mark Turgeon left just eight games into the campaign and Martinez’s promising numbers from his freshman season at Utah plummeted.

He worked his way into the Utes’ rotation upon his arrival in Salt Lake City, averaging 15.8 minutes and 5.2 points on 49.5 shooting in his bit part role.

Each of those numbers dropped last season as Martinez didn’t consistently feature in Maryland’s rotation, and his shooting efficiency plunged despite logging a similar amount of attempts to his year in Utah. He averaged 2.8 points per game and a field goal percentage of just 32.9, the lowest of any Terp to record a made shot attempt.

But Martinez has solidified himself as one of Maryland’s first options off of the bench in its rotation under Willard this season. He’s notched the sixth-most minutes on the team with an average of 18.4 per game, the highest mark of his career.

His field goal percentage rose back up to 43.1 percent and he’s averaged 5.7 points per game this year. Plenty of those points have come off of flashy dunks fueled by the guard’s bounce and aggressive drives to the basket, one of which resulted in a tough and-one layup through contact during Maryland’s upset of then-No. 3 Purdue.

[Maryland men’s basketball stumbles late in overtime loss to Nebraska, 70-66]

Martinez said explosive offensive plays like those boosted his confidence.

“There have been times where I might not be playing as confident and maybe not taking a lot of shots, but in times when I do get the chance … I feel like I should be trying to do it more,” Martinez said.

The guard’s bounce back on offense has helped him stay on the floor, but his defensive intensity is a key reason why he recorded a season-high 30 minutes at Michigan State Feb. 7 and notched a career high in minutes with 34 at Nebraska Sunday.

Despite coming off of the bench, Martinez played the entire second half of the Michigan State game and all but one minute of the second half against Nebraska, when Willard tasked Martinez with guarding the Cornhuskers’ Keisei Tominaga due to his defensive capabilities.

Against the Spartans, Willard credited Martinez’s energy as the reason he didn’t take him off the court after the guard started the second half.

“It just seemed like that first group was just a little sluggish,” Willard said after the Michigan State game. “[Martinez] always gives us a lot of energy, a lot of boost and once they started kind of getting on a roll, I just decided to stay that way.”

Martinez’s offensive improvement and defensive vigor have made him a great fit for Willard’s rotation in his inaugural season, and the coach hopes he continues to develop past the point of being an effective player off of the bench for the Terps.

“[Martinez has] worked really hard to kind of understand what we need from him,” Willard said. “I think he’s still got a lot of room to improve, which is good.”