The 49ers had a plan.

And that plan remained in place even after learning just a couple of days before the draft that veteran left tackle Joe Staley decided the best move for himself and his family was to retire after 13 NFL seasons.

So there the 49ers were, on the clock, at No. 13 overall with a gaping hole at the position that protects the quarterback's blind side.

Over a period of time in their draft preparation, the 49ers envisioned selecting South Carolina defensive tackle Javon Kinlaw.

But, now, the 49ers desperately needed a left tackle, and Iowa offensive lineman Tristan Wirfs was available. Wirfs was a player who would ordinarily be a top-10 draft pick, but this draft featured four high-caliber offensive tackles -- three of whom were selected ahead of him.

“Tristan Wirfs was a player we were extremely fond of,” 49ers general manager John Lynch said Saturday upon the conclusion of the draft. “He’s an unbelievable athlete. He’s an unbelievable player, well-schooled from Iowa. There were so many attributes that we thought extremely highly of.”

“What you do is you set your board. You assess values to everyone, and you take a hard look, ‘Where do we feel we can most help our team?’”

Lynch said a big reason the 49ers were as good as they were last season on their march to the Super Bowl was because the team had a dominant defensive line. The decision was made that Kinlaw gave the 49ers the best chance to remain in serious competition for a Super Bowl after trading DeForest Buckner to the Indianapolis Colts in March.

Listen and subscribe to the 49ers Insider Podcast:



Concurrently, the 49ers were deep into trade talks to acquire seven-time Pro Bowl left tackle Trent Williams from the Washington Redskins.

But as much as the 49ers wanted that deal done, Washington stalled. The 49ers held steady with their offer of a fifth-round draft pick this year, along with a third-rounder in 2021. But Washington held out hope they could get more.

“You’re always nervous, especially what we found out with Joe a couple of days before and not knowing if that (the trade) will go through,” 49ers coach Kyle Shanahan said. “Because if that’s the case, you pass on some pretty good players there at 13.

“But we had a plan for a while going into this. You try your hardest not to panic and adjust that plan, but when you lose a guy like Joe, there is a huge panic there.”

The 49ers even moved back one spot in the first round, picking up a fourth-round pick along the way. The Tampa Bay Buccaneers selected Wirfs. And the 49ers took Kinlaw.

Then, they did not exhale until Washington finally, formally, accepted the 49ers’ offer for Williams early Saturday morning.

Washington had no other competitive offers, but there was more than a little apprehension because of the individuals involved.

There was plenty of acrimony that built between Washington owner Daniel Snyder and the Shanahans during Mike Shanahan’s four-year run as head coach. Kyle Shanahan was the offensive coordinator. It was long believed Snyder would not allow his team to do anything that might benefit the 49ers.

A year ago, when the 49ers called about the possibility of acquiring Williams in a trade after both Staley and Mike McGlinchey were injured, it was made clear to Lynch that there was no possibility of a trade. Williams never stepped on the field for Washington last season.

But Washington has new people running the football side of the organization after the firing of Bruce Allen as team president.

Head coach Ron Rivera and general manager Kyle Smith wanted what was best for their organization. And the deal was made to trade a player who had asked to be traded nearly a year ago and again this offseason.

“We couldn’t guarantee it was going to work out with Washington, but John was as persistent as he could be and we took that risk,” Shanahan said.

Shanahan said it worked out best for the 49ers to stay with their original plan. The 49ers landed Kinlaw and wide receiver Brandon Aiyuk in the first round.

Then, the biggest hole was filled before most people even know the 49ers had a hole to fill. The 49ers acquired Williams, a player Shanahan knows well and compares to Staley for his athletic skills as an offensive lineman and his passion for the game.

[RELATED: Watch Kittle's tribute to Staley]

Then, once Williams was delivered to the 49ers, it was OK for Staley to reveal what he privately told the 49ers earlier in the week: He was retiring from the game.

That was an important piece for the 49ers. They wanted to keep Staley’s decision to retire a secret as long as possible and avoid the possibility that Washington would try to turn the screws even tighter on the trade.

It was Staley’s final selfless act as a member of the 49ers.