The contract stalemate between the Cleveland Cavaliers and Tristan Thompson finally came to an end on Wednesday as ESPN confirmed the two parties agreed to a deal.

Player agent Rich Paul confirmed to Brian Windhorst and Chris Broussard of ESPN that Thompson signed a five-year deal worth $82 million with no player or team options. The deal is also fully guaranteed.

Thompson also confirmed the agreement through a photo posted on Instagram.

Thompson and the Cavaliers engaged in back-and-forth negotiations since the free agency period started in July. The 24-year-old power forward and his camp were demanding for a five-year maximum deal worth around $90 million, but the Cavaliers were only willing to offer an $80 million deal for five years.

Thompson made a counter offer of $53 million for three years, but the Cavaliers did not budge. It led to a contract stalemate, which forced the former Texas standout to skip training camp and their seven preseason games heading into the 2015-16 NBA season.

While Thompson failed to get his initial demands, the four-year veteran still became the sixth-highest paid power forward in the league behind Kevin Love, LaMarcus Aldridge, Blake Griffin, Paul Millsap and David Lee.

Most NBA analysts are also convinced that the deal is too much for a backup power forward, who averaged 8.5 points and 8.0 rebounds per game last season. In the playoffs, where he started in 15 games in place of Love, he posted 9.6 points and 10.8 rebounds per game.

But according to NBA analyst Kevin Pelton, the Cavaliers had no other choice but to sign Thompson because they will have limited options next summer if they decide to let their hardworking power forward go.

"Assuming James re-signs, Cleveland can't realistically clear appreciable cap space next summer, meaning the team's options for replacing Thompson were limited," Pelton pointed out. "The Cavaliers' best hope would have been the $10.5 million trade exception they created by trading Brendan Haywood's non-guaranteed contract."

The Cavaliers, who lost to the Golden State Warriors in the 2015 NBA Finals in six games, successfully kept their core after striking new deals with LeBron James, Love, Iman Shumpert and J.R. Smith this offseason.

It will come at a steep price, though, because they are scheduled to pay around $60 million in luxury tax, which will be the second-highest in league history -- next to Brooklyn Nets' $90.5 million luxury tax bill during the 2013-14 NBA season.