Cleveland Cavaliers' J.R. Smith catches a pass during practice for Game 6 of the NBA basketball Finals, Wednesday, June 15, 2016, in Cleveland. The Cavaliers will play the Golden State Warriors Thursday night in Cleveland. (AP Photo/Tony Dejak)Tony Dejak/Associated Press

Last offseason, J.R. Smith hung out on the free-agent market until August waiting on a new contract. This year, the impasse lasted all the way until October.

But much as he did a year ago, Smith and the Cleveland Cavaliers came to an agreement, the team announced Saturday. His new deal calls for $57 million over four years, per Marc Stein of ESPN, who first reported the deal Friday.

Stein added Smith's deal is fully guaranteed for $45 million through the first three seasons regardless of what happens in the fourth year. Stein also noted the fourth year becomes guaranteed if the Cavaliers don't waive Smith soon after the 2018-19 season ends.

Smith and his family expressed their feelings about the decision, via UNINTERRUPTED:

UNINTERRUPTED @uninterrupted

.@TheRealJRSmith and family are beyond thrilled to be back with the @cavs but also have some other BIG news to share.

LeBron James also took to Twitter to express his excitement:

LeBron James @KingJames

So damn happy for my Lil bro!! Well deserved. Good things happens to good people. I can't express how happy I am for you brother! Love

In his first full year in Cleveland last season, Smith averaged 12.4 points and 2.8 rebounds while starting 77 games. He ranked seventh in the NBA with 204 three-pointers, emerging as a valuable gunner and floor-spacer around James and Kyrie Irving.

The playoffs continued that trend for the most part, as Smith hit 50-plus percent of his threes in sweeps of the Detroit Pistons and Atlanta Hawks. His play was again solid in the conference finals win over the Toronto Raptors but began faltering before reaching a (brief) nadir in the NBA Finals.

Smith had just eight total points as the Cavaliers dug themselves an 0-2 hole against the Golden State Warriors, but he returned to form in the final five games. He scored 12 points in the Cavaliers' Game 7 victory, including a critical run of eight straight points at the start of the second half.

Consistency, as it always has been, was Smith's undoing. He had three games of 20-plus points and five of six or fewer. There were times when Smith looked like the third in command behind James and Irving and others when he looked lost.

Still, Smith's biggest contribution to the Cavs this past season may have been his improvement on defense. While still a long way from a lockdown defender—backdoor cuts and sloppy rotations still littered his game—he showed a far greater commitment on that end all season. He was at times average defensively—a massive uptick from his previous struggles.

"Before this year, if you caught me in the summer and asked me questions like what are you going to do on pick-the-picker or backside rotations, I'd have been like, um, what?" Smith told ESPN.com's Brian Windhorst.

Those improvements more than anything were expected to land Smith a nice raise in free agency. A year ago, he waited until August to sign a two-year deal worth less annually than the one he opted out of. He went on to say:

The market was going crazy, I mean it was ridiculous. You see so many people getting paid. I started to look at myself in the mirror and was like, "Damn, am I really what everybody saying I am? Am I really a cancer?" We'd just gotten to the Finals, and I'm not trying to toot my horn, but I thought I'd had a major part in that.

The market was even more boisterous this summer, with the cap reaching a record $94 million. Mid-tier rotation guys were handed eight-figure salaries like it was nothing, while Smith for some reason continued lingering—seemingly unwanted. The situation in many ways mirrored Tristan Thompson's negotiations a year ago.

"It's more than just numbers. I don't want to feel like I'm taking advantage of the Cavs for everything they've done for me, and I don't want them to feel like I'm taking advantage of them. It's more of a mutual respect thing," Smith told Adam Campbell of Complex.

With the new deal signed and sealed, it appears Smith enjoys the security of Cleveland over everything.