C.J. Beathard was one of the surprises of the draft.

Well, the third-round selection of the former Iowa quarterback surprised everyone except the team that drafted him. The San Francisco 49ers moved into the back end of the third round and picked Beathard, who was widely regarded as a Day-3 prospect.

Peter King, of Monday Morning Quarterback, was in the 49ers draft room to chronicle the experience of first-time general manager John Lynch and new coach Kyle Shanahan. As King reported, Beathard was actually the only quarterback that Shanahan wanted in the draft.

They made the move because as general manager Jed York said, “they’d sleep a lot better (Friday night)” if they went up and grabbed the former Iowa signal-caller. Beathard’s new coach had some high praise for him after the 49ers picked Beathard.

“He processes the game so well,” Shanahan said via MMQB. “Tough as s—. Got a chance. He reminds me a lot of Kirk Cousins.”

RELATED: Looking back on an interesting final day of the draft for the B1G

Shanahan was Cousins’ offensive coordinator in Washington before he left to take the same position in Atlanta. The former Michigan State star was rumored to be the 49ers’ top offseason target, but for now, he’ll play 2017 under the franchise tag again.

That was a flattering comparison for Beathard, who played through no shortage of injuries in his two seasons as Iowa’s starter. But it wasn’t as flattering as the one that was later pointed out to him. This excerpt from the MMQB story says a lot about what the 49ers think of Beathard:

Of course, there is an almost mythological quality to this trade. Think of it. In 1979, Bill Walsh, with only veteran journeyman Steve DeBerg to give him a chance to win that season, waited until the end of round three to take a lightly regarded Midwestern quarterback, Joe Montana. In 2017, John Lynch, with only veteran journeyman Brian Hoyer to give him a chance to win this season, waited until the end of round three to take a lightly regarded Midwestern quarterback, C.J. Beathard.

“Oh my God,” Beathard said upon learning his link to Montana. “That is crazy. Wow. Joe Montana. Wow.”

Beathard has a long way to go before becoming the next Montana, Cousins or even former MSU quarterback Hoyer, who is the No. 1 signal-caller on the 49ers depth chart.

But clearly, the 49ers think Beathard has plenty of upside.