Former Stanford and NFL star safety John Lynch is the 49ers’ stunning choice as general manager, ending a four-week search that never publicly connected him to the opening, the team confirmed Sunday night.

Lynch, 45, won over the 49ers brass with his leadership and communication skills, as well as his link to former 49ers coach Bill Walsh, who coached Lynch at Stanford 25 years ago, CEO Jed York told this newspaper.

Lynch, a finalist for Saturday’s upcoming Pro Football Hall of Fame class, is expected to pair with presumptive coach Kyle Shanahan as the 49ers rebuild after a 2-14 season that cost the jobs of general manager Trent Baalke and coach Chip Kelly.

Shanahan, the Atlanta Falcons offensive coordinator, can not be officially hired until after next Sunday’s Super Bowl. Both he and Lynch are expected to land six-year contracts despite no previous experience as a head coach or general manager, respectively.

The 49ers plan to introduce Lynch on a media conference call Monday, as he is out of town tending to a family commitment.

York noted that Lynch will surround himself with a “great staff” in his first foray into a NFL front office, where the 49ers are expected to complement him with a veteran personnel executive. One such candidate could be Mark Dominik, an ESPN analyst and former Tampa Bay Buccaneers general manager who was the Bucs’ director of pro personnel during Lynch’s playing career there. Another option could be Tom Gamble, the 49ers assistant general manager; he declined comment Sunday night.

Lynch flew up Thursday from his San Diego home to meet with York, who’s spearheaded the 49ers’ GM and coach search. Lynch stayed Thursday night at York’s Los Altos estate, according to ESPN’s Adam Schefter, who also reported that Lynch approached Shanahan last week about assuming the GM role.

On Friday, Lynch flew with York and 49ers chief strategy officer Paraag Marathe to Atlanta for a follow-up interview with Shanahan, who also sat in on Saturday’s sessions with the 49ers’ two presumed GM finalists, the Minnesota Vikings’ George Paton and the Arizona Caridnals’ Terry McDonough.

var _ndnq = _ndnq || []; _ndnq.push([’embed’]);

Kyle Shanahan “is good” with Lynch’s hiring, a source close to Shanahan told Bleacher Report’s Jason Cole. If Shanahan obtains roster control over Lynch, it wouldn’t be unheard of in the NFL, as between six and eight coaches wield that power, which was given to first-time coaches Dan Quinn in Atlanta and Adam Gase in Miami each of the past two years upon their hiring.

Lynch and Shanahan are bridged together through the Denver Broncos a decade ago, when Lynch was finishing his All-Pro career and Shanahan’s father, Mike, was coaching the Broncos.

The 49ers’ GM search included interviews with eight known candidates, and none has ever previously been a general manager. Some withdrew from consideration (Green Bay’s Eliot Wolf and Brian Gutekunst, and Seattle’s Trent Kirchner), and the 49ers could not procure interviews with two potential GMs, New England’s Nick Caserio and Kansas City’s Chris Ballard, the latter of whom filled the Indianapolis Colts’ GM job Sunday.

Lynch was a 1993 third-round draft pick by the Tampa Bay Buccaneers out of Stanford. He played for the Buccaneers through 2003, including winning a Super Bowl against the Raiders, before playing out his career with the Broncos from 2004-07. He made nine Pro Bowls and earned All-Pro status from 1999-2001.

Reading this on your phone or tablet? Stay up to date on Bay Area and Silicon Valley news with our new, free mobile app. Get it from the Apple app store or the Google Play store.

Lynch was inducted this season into the Buccaneers’ and Broncos’ respective Rings of Honor, doing so in a 10-day span. He played in 224 regular-season games, totaling 26 interceptions and 13 sacks, according to his Pro Football Hall of Fame bio as a 2017 finalist.

He actually finished his hard-hitting career with the New England Patriots in the 2008 exhibition season, providing his last memories on a field.

“If you look at the stat sheet, I had like 14 tackles,” Lynch told the Tampa Bay Times in October. “I was like Junior Seau. They’d tell me it was zone coverage — and I would blitz. (Bill) Belichick was screaming, ‘What the hell are you doing?’ I came off one time and I gave him a hug. He finally just cracked a huge smile. I was out there just balling.”

Since retiring, Lynch has been a Fox Sports broadcaster. His hiring is sure to draw comparisons to the Detroit Lions’ appointment of Matt Millen as their CEO and personnel czar from 2001-07, as he left the broadcast booth a decade after his playing career.

Lynch has kept abreast of the 49ers’ decline in recent years, telling 95.7 The Game two years ago: “With all due respect to Jim Tomsula, they let go of Jim Harbaugh, a tremendous coach. I think it’s a failure of the organization.”

Baalke had presided over the 49ers personnel department since 2010, highlighted by three consecutive berths in the NFC Championship Game and a Super Bowl appearance, all with Harbaugh as coach. Tomsula was ousted after going 5-11 in 2015, and Kelly coached the 49ers to a franchise-record 13 consecutive losses en route to this season’s 2-14 record.

Lynch was a two-sport star at Stanford, and he played two seasons of minor-league baseball with the Florida Marlins organization as a 1992 second-round draft pick. He threw the first pitch in their history with their first farm team, the Erie Sailors.

The Stanford Athletic Hall of Fame enshrined Lynch in 2010, well after he earned second-team All-America honors in 1992 under Walsh, who returned that season for a three-year encore as Cardinal coach. Lynch originally went to Stanford as a quarterback before transitioning to safety.

Before going to Stanford, he attended high school Torrey Pines High School near San Diego, where he lives with his wife, Linda, and their four children.

As for his health after 15 years of hard-hitting NFL action, Lynch told the Tampa Bay Times in October: “My head was always good. For a guy who played 15 years, I’d put myself up against anyone in terms of fewest concussions. I’m very healthy today. I still run. My head feels great.”

Lynch is a Pro Football Hall of Fame finalist for a fourth straight year, and this year’s class will be revealed on Saturday in Houston, site of Super Bowl LI.

Lynch can only hope his transition to the front office goes as well as his from a player to a broadcaster.

“My first three years as an NFL player, I kind of was a special teams player struggling to find my way on the field. Broadcasting, I think I did well from the start,” Lynch told the San Diego Union-Tribune two years ago. “It’s really taken off here in the last couple of years. That’s been fun, to see that progression, and I worked around a lot of great people that helped me.”

He’ll need a strong supporting cast upon joining the 49ers, and York is convinced Lynch indeed will do that. The 49ers certainly have the resources available for a needed rebuild. Beside an expected $100 million in salary cap space, they have at least 10 draft picks this year, including No. 2 overall behind the Cleveland Browns.