SANTA CLARA -- 49ers CEO Jed York in 2017 was looking for an offensive-minded head coach who could get the most out of his quarterback.

But when the 49ers hired coach Kyle Shanahan, the organization did not have any quarterbacks under contract at the time free agency began.

General manager John Lynch and Shanahan informed Colin Kaepernick he did not fit the team’s offensive plan and would be released, so Kaepernick opted out of his contract. The 49ers had no interest in re-signing Blaine Gabbert, either.

Instead, the 49ers signed Brian Hoyer and Matt Barkley at the start of free agency. C.J. Beathard was drafted, and Nick Mullens signed as an undrafted rookie.

But the 49ers did not add the quarterback they knew would be their answer until the middle of the 2017 season when New England Patriots coach Bill Belichick offered QB Jimmy Garoppolo to the 49ers for just a second-round draft pick.

“When we made the trade in the middle of the season, Kyle was probably the most conservative with it,” York said. “Everybody from Mandy Shanahan (Kyle’s wife) to all our fans were ready for him to start Day 1.

“But we had to make sure that we did it the right way. And we didn’t do something just because it was going to get the fans fired up. We wanted to put Jimmy in the right situation to be successful.”

York said Shanahan told Garoppolo he might not take a snap in a game for the rest of the season, as Garoppolo had to learn at least the basics of the offense. Shanahan told Garoppolo that he was not on an audition.

Garoppolo was scheduled to be an unrestricted free agent at the end of the season, and the club was going to, at least, put the franchise tag on him for more than $23 million to keep him around for the 2018 season.

[RELATED: How Shanahan, Lynch make 49ers CEO York's job easier]

Garoppolo got his first chance to start in Week 13, and it began a remarkable stretch of success for the 49ers. The club began the season 0-9, and after five consecutive victories with Garoppolo as the starter to finish the season, the 49ers finished at 6-10.

Five weeks later, York signed off on a five-year, $137.5 million contract for Garoppolo. The 49ers got little return on that investment in 2018 when Garoppolo sustained a torn ACL in Week 3.

This season, Garoppolo flourished as a starter in all 18 games en route to Super Bowl LIV against the Kansas City Chiefs next Sunday in Miami.

Garoppolo earned immediate trust and confidence from his teammates and the entire organization since his arrival in Santa Clara, and he has done nothing to give anyone in the organization reasons to doubt him ever since.

[RELATED: How Jimmy G's impact on 49ers goes beyond the numbers]

“If you don’t have a quarterback who can win in big games and big moments, it’s really, really hard to get to this point,” York said. “And Jimmy, obviously, exceeded any expectations in those games that you could ever ask for a player coming into an organization.

“And he’s continued to improve, he’s continued to work, he’s continued to get better. If you don’t have a quarterback, to me, you just don’t have a chance. It was a must.”