Lynch comes into the job with no front-office experience, having gone straight from the playing field to the broadcast booth. But after a lengthy search that included interviews with nine other publicly identified candidates, team CEO Jed York settled on Lynch.
ESPN first reported the deal, saying Lynch had gotten a six-year contract.
After playing for former Niners coach Bill Walsh in college at Stanford, Lynch went on to have a stellar 15-year career with Tampa Bay and Denver that included three All-Pro selections and one Super Bowl title with the Buccaneers. He's a finalist this year for the Pro Football Hall of Fame.
Since retiring in 2008, Lynch has been an analyst at Fox.
Now he will be tasked to rebuild a once-proud franchise that has fallen from NFC champions in 2012 to a 2-14 record this past season that matched the worst in franchise history. That led to the firing of Baalke and coach Chip Kelly as York set to overhaul the operation after the struggles the past few years.
The 49ers made three straight trips to the NFC title game from 2011-13 under coach Jim Harbaugh, but got rid of him after an 8-8 season in 2014, in part because of a rift with Baalke. Jim Tomsula lasted one year as coach and then Kelly was also fired after one season, leading to this current search.
York said he was open to hiring either the coach or general manager first. He said the primary goal in the search is finding a coach and general manager who can work well together.
All signs point to Atlanta offensive coordinator Kyle Shanahan getting the head coach job. He had a second interview with York this weekend and is the only remaining candidate. He can't sign a contract with San Francisco until after the Falcons play the Super Bowl next Sunday against New England.
Lynch played for Shanahan's father, Mike, for four seasons in Denver.
York also gave second interviews this weekend to the two other general manager candidates: Minnesota assistant GM George Paton and Arizona vice president of player personnel Terry McDonough.
But after meeting with them and Shanahan, York decided to go with Lynch for the job. Lynch played the final four years of his career in Denver, where Shanahan's father, Mike, was head coach.
Lynch will need to rebuild a depleted roster that has few building blocks and holes at nearly every position. The biggest void is at quarterback where Colin Kaepernick and Blaine Gabbert both struggled this past season and can leave as free agents in March.
San Francisco has the No. 2 overall draft pick and plenty of salary cap room to make additions.