After preparing all offseason to not have Jimmy Garoppolo on the roster, Kyle Shanahan calls the quarterback's return to the San Francisco 49ers a "win-win."

On Monday, the Niners agreed to a re-worked one-year contract worth about $7 million and up to $16 million with incentives with Garoppolo.

"The chances were, to me, it seemed slim to none," Shanahan said of Garoppolo remaining with the team. "I remember the first week of training camp me saying to Jimmy like, 'Hey, if you don't like any of these opportunities, if you don't go to the place you want, you can't get the contract that you want, we would love to have you here as a backup in that deal.' I want you to know that we feel that way but I also think there's no way you're not gonna get something as this goes throughout training camp."

Both sides fully expected Garoppolo to be elsewhere this season. So much so that the quarterback continued his recovery throwing program on the side while the Niners practiced on neighboring fields.

Shanahan said Tuesday that he had conversations with Trey Lance about Garoppolo returning before the move was made and that Lance was "great" about it and had "no problems with it at all."