The Miami Heat reached a deal with a free agent Thursday, but it wasn't the player many expected it to be. Big man Kelly Olynyk agreed to a four-year deal with Miami worth $50 million-plus, according to Adrian Wojnarowski of ESPN. The fourth year includes a player option.

Olynyk spent the last four seasons in Boston where he averaged 9.5 points and 4.7 rebounds per game, but the Celtics had to renounce their rights to him this week after landing All-Star forward Gordon Hayward in order to make room for him on their books.

The Heat came up short in the Hayward free agency sweepstakes after losing out to the Boston Celtics, who have agreed to pay Hayward $128 million on a four-year deal.

Olynyk is a 26-year-old, 7-footer who could fill a role for the Heat as a stretch big man. He's a career 36.8 percent three-point shooter that will fit nicely in the Miami offense, but his ceiling is decidedly lower than most given his sample size in Boston and below average athleticism.

>>Rudy Gay Signs With San Antonio

Free agent forward Rudy Gay has agreed to join the San Antonio Spurs on a two-year, $17 million-plus deal with a player option, Adrian Wojnarowski reports.

Gay appeared in just 30 games with the Kings in the 2016-17 season but suffered a torn achilles that sidelined him for a majority of the season.

Gay, 31, reportedly chose San Antonio to become a part of a contender. He met with the Oklahoma City Thunder this week as a potential suitor but there was a gap between what the Thunder were willing to pay and what Gay was asking for on the market. OKC ultimately signed Patrick Patterson and chose to re-up with defensive stopper Andre Roberson.

Gay averaged 19.3 points and 6.0 rebounds per game in his four seasons with the Sacramento Kings, and will now join the Spurs as a potential second option to All-Star Kawhi Leonard.