SANTA CLARA, Calif. -- Although he had picked up steam as a possible first-round pick for the San Francisco 49ers in the final days before the 2018 NFL draft, hearing offensive tackle Mike McGlinchey's name called at No. 9 came as a surprise.

Not just to fans, media and other outside observers, who expected the Niners to continue their recent trend of drafting defense in the first round, but to McGlinchey himself.

"I had no idea," McGlinchey said. "It’s definitely a shock, but [I'm] absolutely thrilled to be a part of the San Francisco 49ers organization."

To get the player they expect to step into the starting right tackle job and eventually be the heir to Joe Staley's left tackle spot, the Niners put together a clandestine operation that went to great lengths to prevent others from catching wind of their interest.

The Niners' interest in spending a premium pick on an offensive tackle actually began on Oct. 29.

The 49ers were very coy in their interest in Mike McGlinchey, throwing nearly everyone off their scent. Josie Lepe/AP

That day, the 49ers were blown out by the Philadelphia Eagles. In addition to the 33-10 loss, they watched helplessly as Staley departed with a fractured orbital bone and right tackle Garry Gilliam was lost to a season-ending knee injury. With right tackle Trent Brown already out because of a concussion, the Niners finished the game with backup guards Zane Beadles and Erik Magnuson at tackle. Brown then suffered a season-ending shoulder injury in December.

Soon after, general manager John Lynch and coach Kyle Shanahan began discussing the need to plan for the short- and long-term future of the position. With Staley set to turn 34 in August and Brown poised to be a free agent after the 2018 season, tackle was not the most pressing need, but Lynch and Shanahan came around to how important it was to address before it became one.

Lynch and Shanahan met with McGlinchey for the first time at the scouting combine in Febrauary. McGlinchey sat with the Niners as one of their 60 formal interviews in Indianapolis. McGlinchey had 25 such interviews that week but remembered walking away with a great feeling about his connection with Shanahan and Lynch.

The feeling was mutual.

"Just as a general philosophy, you didn't want to put too much stock in that because it's 15 minutes," Lynch said. "I will say, however, there's some people who command a room and who own a room. ... We have 60 interviews at the combine, and he was a guy that came in and just kind of owned the room, and everyone felt it. It wasn't just me. Kyle felt that way. Our coaches that were in the room felt that way, our scouts in the room. He's got a special presence to him. He's real. He's authentic, and he's a badass, and we like that."

Counter-intuitive as it might sound, the Niners liked him so much that they broke off most contact with McGlinchey after that meeting. Although they had more work to do on him from a film-study standpoint, they reached out to his camp only once before Lynch called to inform McGlinchey he was the pick on Thursday night.

That contact came in the form of setting up an early April private workout at Notre Dame. Soon after making those arrangements, though, the Niners decided to cancel. McGlinchey was not deterred by the cancellation, though it contributed to his surprise when the 49ers picked him.

"It kind of would have been a waste of time," McGlinchey said. "They can watch the film, and they're flying from California to South Bend. It's really not that worth it to do a 15-minute workout, so that was my thought process. I really didn't think that much into it, but that was just kind of funny how that worked out."

2018 NFL DRAFT All 256 picks are in. Full coverage » • Kiper: Draft grades for every team »

• McShay: Every team's best pick »

• Nation: Top post-draft questions to follow »

• Nation: Breaking down picks by team »

• Graziano: Biggest post-draft stories »

• Trade tracker: Every move, by team »

• McShay: Top undrafted prospects »

• Barnwell: Who aced Round 1 trades »

• New digits: Picks get jersey numbers »

• Kiper's winners: Day 1 » | 2 »

• McShay's awards: Day 1 » | 2 »

• Nation: Pros, cons for first 32 picks »

In that same vein, the 49ers took other steps to prevent their interest in McGlinchey from getting out. For one, they did not invite him to the Bay Area as one of their 30 pre-draft visitors.

"He wasn't going to change much by bringing him in, so that was a guy we decided, 'Hey, let's lay under the radar,'" Lynch said. "We did that for good reason. And then I would tell you, from the combine, you know, closer to the draft, our feelings for him only got stronger, so we're glad that we chose to not bring him in. So we just didn't want anything out there that he was the guy we were interested in."

In the weeks that followed that interview, Shanahan, Lynch and their staff continued to do legwork on McGlinchey. The more film they watched, the more they grew to believe in him. With so many quarterbacks projected to go before them, the 49ers believed there was a rare opportunity to land the draft's top tackle at the back end of the top 10.

As that belief grew stronger, so did the Niners' efforts to keep their interest quiet. Shanahan took it seriously enough to eschew calling on one of his closest connections to McGlinchey. Atlanta quarterback Matt Ryan is McGlinchey's cousin and won a league MVP under Shanahan's tutelage with the Falcons.

"I didn't want to blow our cover," Shanahan said. "We haven't talked to Mike since the combine, and I definitely would have checked in with Matt if we were worried about something. But we felt very good about the guy and the person. I got a text right from Matt after we drafted him, and I got to return a call here in a second, so I'll call him now. But trust me, I had to keep it a secret."

It was a secret the 49ers kept even from McGlinchey. Even as McGlinchey's name got hotter in league circles, the team most often linked to him was the Oakland Raiders.

"I didn't know anything until the day or two before," McGlinchey said. "Oakland, we were pretty confident that was where I was going to go if I was there, so that's all I really knew. And if that didn't happen, I was just going to keep waiting. I didn't know anything about the 49ers."

The Niners, who won a coin toss with the Raiders for the No. 9 pick, were considering other top players such as Georgia linebacker Roquan Smith. But about a week before the draft, Lynch & Co. settled on taking McGlinchey with their pick.

Finally, in the days before the draft, the team's interest in McGlinchey began to leak, but by that point, it was fair to wonder if that was the usual last-minute misdirection.

After Smith went No. 8 to Chicago, the Niners began receiving calls from teams interested in moving up into the No. 9 spot. The 49ers weren't interested in moving back. They had their man, and it was time to let everyone else in on the secret.

"We felt that we had an opportunity to get the best tackle in the draft and I think a lot of people in the league felt that way," Shanahan said. "When you're in that situation, a lot of people are desperate for him, and that's why you have to keep it somewhat of a secret because people will jump you and take them because they are limited."