This marks a reunion between Lewis and new 49ers head coach Chip Kelly, as Matt Barrows of the Sacramento Bee noted the 28-year-old was with the Philadelphia Eagles last season but did not take a snap.
An undrafted free agent out of Duke in 2010, Lewis has played sparingly throughout his career. His most productive season was in 2013 with the Buffalo Bills. He started five games, threw for 1,092 yards with four touchdowns and three interceptions.
The 49ers have an uncertain quarterback situation right now. Colin Kaepernick and Blaine Gabbert are still on the roster, though Kaepernick's position seems precarious.
ESPN's Adam Schefter reported in December that the 49ers "expressed" an interest in bringing Kaepernick back. San Francisco general manager Trent Baalke told reporters (via ESPN.com news services) in February Kaepernick would be on the team's roster April 1, when his 2016 salary becomes fully guaranteed.
Getlin recently reported that Kaepernick's agents have requested permission to seek a trade out of San Francisco for the 28-year-old quarterback.
It's unclear how, if at all, Lewis' addition impacts the Kaepernick situation. The 49ers certainly wouldn't look to Lewis as their starter after Gabbert performed adequately in the second half of 2015. The team also owns the No. 7 overall pick in April's draft to potentially address the position.
Lewis' established relationship with Kelly certainly helped him find a home in San Francisco. His resume as a backup gives the 49ers options to play with this offseason to decide a direction they want to take at quarterback before training camp starts this summer.