Cleveland Cavaliers superstar LeBron James did not hide his happiness when he learned that free-agent guard J.R. Smith has secured a new deal.

Smith, who opted out of the final year of his contract to become an unrestricted free agent, announced on Instagram that he has decided to return to Cleveland.

"Happy to say that I am returning to the Cavs," Smith wrote. "It's been a long ride this summer but I can say for sure, well worth the wait. When I opted out of my contract, I wanted to understand the landscape of the NBA and where I fit best."

James, who developed a good relationship with Smith last season, took to Twitter to welcome the veteran back to Cleveland.

Smith, who was traded by the New York Knicks to the Cavaliers in January, was supposed to receive $6.5 million in the in the final year of his contract in the upcoming season.

However, the 29-year-old decided to opt out of his contract after averaging 12.1 points on top of 3.1 rebounds and 2.8 assists in Cleveland last season. He provided additional scoring threat to the Cavaliers, who eventually earned a spot in the NBA Finals, where they lost to the Golden State Warriors.

But instead of getting a bigger deal, Smith lost $1.5 million in the process, as ESPN reported that the 11-year veteran signed a two-year deal worth $10 million with a player option in the second year and no-trade clause.

Smith hinted that he received bigger offers from rival teams, but he decided to return to Cleveland to get the best chance of winning an NBA title in the near future.

"I ended up deciding that instead of potentially securing a larger deal elsewhere, I wanted to rejoin an incredible organization in pursuit of the ultimate goal, an NBA championship," Smith said. "Thank you to the Cavaliers for making this happen. Can't wait to get started!"

The Cavaliers also signed LeBron James, Kevin Love, Iman Shumpert, James Jones and Matthew Dellavedova to new deals this offseason. They are also negotiating with restricted free agent power forward Tristan Thompson.

Aside from their own free agents, the Cavaliers also signed veteran point guard Mo Williams and forward Richard Jeffers, and are reportedly on the verge of adding Russian center Sasha Kaun to their roster.