After the seemingly never-ending tug of war between both sides, the Houston Rockets have signed restricted free agent Donatas Motiejunas to a four-year, $35 million deal, according to Adrian Wojnarowski of The Vertical.

Minutes prior to the deal, the team had pulled their previous matching offer and re-negotiated to new terms that would please both sides. The 26-year-old only needs to pass his physical to return to the team.

The parameters of the new deal are similar to the original Brooklyn Nets offer sheet, with only one season fully guaranteed, according to league sources.

Motiejunas will make $8.3 million this season and Houston will own a team option in each July of the next three seasons, per Wojnarowski. Total bonuses could inflate the deal to a total $37 million if he plays out the entire length of the deal.

Under the matched offer sheet, Motiejunas had a one-year waiting period to be traded and would need to consent on any possible deal, per Marks.

The Rockets have taken a wise, sagacious approach to the making of this deal despite the unwillingness to cooperate from the 7-footer's agent, BJ Armstrong.

Assuming he doesn't no-show for this physical, it shouldn't be long for Motiejunas to be back on the court backing up Ryan Anderson and Clint Capela. Montrezl Harrell and Nene will likely take most of the hit in minutes played upon the big man's return.