When the San Francisco 49ers drafted Trey Lance with the third overall pick last year, the writing was on the wall. Jimmy Garoppolo's time with the team was going to come to an end.

The Niners officially named Lance their starting quarterback in July and reportedly gave Garoppolo permission to seek trades.

After no trade developed, the Niners and Garoppolo agreed to a restructured deal that keeps the veteran in the Bay Area as the Niners' backup QB.

Kyle Shanahan and Jimmy Garoppolo before Super Bowl

Head coach Kyle Shanahan and Jimmy Garoppolo (10) of the San Francisco 49ers talk on the field before a game against the Kansas City Chiefs in Super Bowl LIV at Hard Rock Stadium Feb. 2, 2020, in Miami, Fla. The Chiefs defeated the 49ers 31-20. (Michael Zagaris/San Francisco 49ers/Getty Images)

"We were so pumped, because it's obviously a better situation for the Niners. We love getting Jimmy back," head coach Kyle Shanahan told reporters Tuesday, adding it was a "win-win for both sides."

CLICK HERE FOR MORE SPORTS COVERAGE ON FOXNEWS.COM

Shanahan said there were conversations about Garoppolo sticking around ever since Lance was named the QB, and both parties did exhaust practically every option.

Garoppolo hadn't been practicing or going to team meetings given his uncertain future. That gave the Niners a chance to see Lance take snaps with the starters and get looks at potential backups Nate Sudfeld and Brock Purdy.

"We wanted to do that because we thought that's how it was going to be," Shanahan said. "And we thought there was no way that someone in the league wouldn't come with a better opportunity [for Garoppolo]. One that Jimmy thought was a better opportunity and, fortunately for us, they didn't … 

"Having Jimmy there as a backup makes us feel really good, because we have a starting quarterback as a backup. The rest of the league had a chance to get him, and I just so feel so fortunate that he's still here in that case. And in no way does that hurt our team. It's only helped our team." 

Jimmy Garoppolo drops back

Jimmy Garoppolo of the San Francisco 49ers looks to pass in the NFC championship game against the Los Angeles Rams at SoFi Stadium Jan. 30, 2022, in Inglewood, Calif. (Ronald Martinez/Getty Images)

Every fan's favorite player is the competent backup QB when the starter is struggling. But Shanahan doesn't feel that cries for Garoppolo if, and when, Lance does struggle will become problematic.

49ERS' TREY LANCE DISCUSSES RELATIONSHIP WITH 'BIG BRO' JIMMY GAROPPOLO DESPITE REPLACING HIM AS STARTING QB

"Jimmy dealt with that … every single game last year because we drafted a young guy," Shanahan said. "So, every time we lost, he heard it. It was from the narrative and everybody because that's the position. It's the quarterback's fault. And Jimmy had to deal with that for a long time. I don't think that affected us last year in that case. And I think we persevered through a lot of stuff and just tried to do what was best on the field. And I don't see any difference this year."

Despite Garoppolo's benching, Shanahan said there was "no relationship to mend" with Garoppolo, suggesting that all is well between the two.

Jimmy Garoppolo postgame

Jimmy Garoppolo of the San Francisco 49ers walks off the field after being defeated by the Los Angeles Rams in the NFC championship game at SoFi Stadium Jan. 30, 2022, in Inglewood, Calif. The Rams defeated the 49ers 20-17.  (Christian Petersen/Getty Images)

CLICK HERE TO GET THE FOX NEWS APP

The Niners open their season in Chicago against the Bears Sept. 11.