Coach Chip Kelly and the 49ers used the first day of free agency to reach a contract agreement with a quarterback.
The 49ers agreed to terms on a one-year contract with Thad Lewis, a league source confirmed to CSNBayArea.com.
Lewis is familiar with Kelly’s system after signing with the Philadelphia Eagles on Sept. 21. He did not appear in any games.
[MAIOCCO: Broncos GM Elway: 'I've always liked Colin']
Lewis becomes the fourth quarterback the 49ers have under contract, joining Blaine Gabbert, Colin Kaepernick and Dylan Thompson.
Lewis, 28, has not seen action in an NFL regular-season game since 2013, when he completed 93 of 157 attempts (59.2 percent) for 1,092 yards with four touchdowns and three interceptions in five starts with the Buffalo Bills.
He also started one game with the Cleveland Browns in 2012, completing 22 of 32 passes (68.8 percent) for 204 yards with one touchdown and one interception.
The NFL Network was first to report the agreement.