Miami Heat guard Duncan Robinson (55) gestures to referee Ed Malloy (14) during the first half of Game 3 against the Milwaukee Bucks in an NBA basketball first-round playoff series Thursday, May 27, 2021, in Miami. Credit: Marta Lavandier / AP

The Miami Heat is keeping sharp-shooter Duncan Robinson, according to a source.

The terms on his new deal, as first reported by ESPN: five years, $90 million. That’s $18 million annually for one of the league’s best shooters.

Robinson can opt out after four seasons.

In the past two regular seasons combined, only Sacramento’s Buddy Hield (553) and Portland’s Damian Lillard (545) have totaled more made threes than Robinson (520).

Robinson was the only Heat player to appear in all 72 games this regular season. He closed this past season with the fourth-most made threes in the NBA at 250 — behind Lillard (275), Hield (282) and Golden State’s Stephen Curry (337), and shot 40.8 percent on 8.5 three-point attempts per game.

Robinson averaged 13.1 points and shot 40.8 percent on threes last season, one year after averaging 13.5 points and shooting 44.6 percent on threes.

Robinson set a Heat record for threes made (270) in a single season in 2019-20, while also joining Curry as the only two players in league history to finish a season with 270 or more made threes while shooting better than 44 percent from deep.

Robinson, born in York in 1994, played one season at NCAA Division III Williams College  before transferring to the University of Michigan in 2015.

Undrafted out of Michigan, Robinson made more three-pointers in a season than any undrafted player in NBA history.

The Heat had the right to match any offer for Robinson, but Robinson wanted to stay and agreed to terms in the first 20 minutes of free agency.

The emphasis for Robinson, 27, this summer? Working on his body, developing a go-to two-point shot and finding ways to earn more trips to the free-throw line.

“Obviously for me, it’s keep the main thing the main thing,” Robinson said during a recent episode of The Long Shot podcast. “I understand what I’m good at. I think that’s part of my strength as a player is that I know who I am, and I don’t try to do more than that.

“With that being said, you still never want to put yourself in a box. So there’s always room for improvement and development. I have a lot of room for improvement offensively, particularly when it comes to inside the three-point line.”

Robinson, who has scored 80.5 percent of his points on threes and has averaged one free-throw attempt per game in the regular season during his NBA career, is working to establish a consistent go-to two-point shot “whether it’s a midrange pull-up, whether it’s a floater.”

“If you look at it as simple as if I get one more layup a game, that’s two points,” Robinson said. “If I get to the line one more time a game, that’s two more trips to the line and I’m a pretty good free-throw shooter. So that’s basically another two points. … That’s going from averaging 13 or whatever it is points per game to 17, and that’s a big difference in winning and losing during an NBA season.”

Robinson is also working on his “lower body,” which he hopes translates into him “moving better.”

“I have some movement deficiencies, limitations, whatever you want to call them,” Robinson said on his podcast. “For me, it becomes how I then mitigate those limitations. I think I got to the point toward the end of the year where I was definitely respectable on defense.

“I also know I’m always going to be called out and every time I give up a bucket, it’s going to be: ‘Oh, that guy can’t guard a chair.’ But with that being said, I’ve made a lot of improvements since I’ve been in the NBA. But then it’s about how do we continue to push this forward and build.”

Story by Barry Jackson, Miami Herald. BDN writer Leela Stockley contributed to this report.