Free-agent guard J.R. Smith re-signed with the Cleveland Cavaliers Thursday night.

In June Smith opted out of the final year of his contract with the Cavaliers. However he wasn’t able to get a bigger deal with another team. The new deal is for two years and more than $10 million, according to ESPN. There is a player option in the second year. Smith will be able to veto any trades this season because of the collective bargaining agreement rules.

“Happy to say that I am returning to the Cavs! It’s been a long ride this summer but I can say for sure, well worth the wait,” Smith wrote on Instagram. “When I opted out of my contract, I wanted to understand the landscape of the NBA and where I fit best. The Cavaliers had things they needed to do in order to piece together a championship caliber roster. 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. Thank you to the Cavaliers for making this happen. Can’t wait to get started! #TheLand”

Smith was acquired by the Cavaliers in January in a trade with the New York Knicks. He averaged 12.7 points, 3.5 rebounds, and 2.5 assists with the Cavaliers last season, according to USA Today. In the playoffs he averaged 12.8 points and 4.7 rebounds.

The Cavaliers now have 12 players under contract. They are working on a long-term deal with restricted free-agent forward Tristan Thompson.

Image via Instagram from >J.R. Smith