Ian Williams sticks with San Francisco

Defensive tackle Ian Williams has agreed to return to the San Francisco 49ers on a five-year deal, a league source told ESPN NFL Insider Adam Schefter.

The 6-foot-1, 305-pound nose tackle is coming off his most productive season. That he was finally healthy had more than a little something to do with it.

Starting in all 16 games, Williams had a career-high 65 tackles with one sack, a forced fumble, a fumble recovery, a pass defended and a blocked kick.

He has emerged as an important member in the middle of San Francisco's once-stout defense, which lost linebacker Patrick Willis to retirement last March followed by Chris Borland and veteran defensive end Justin Smith. Aldon Smith was released then joined the Oakland Raiders before being hit with a yearlong suspension.

An undrafted free agent out of Notre Dame, Williams appeared in four total games his first two seasons. He became the Niners' starting nose tackle in 2013 before a broken ankle in Week 2 ended his season. In 2014, his season ended after nine games due to a broken leg.

As well as being an integral part of the San Francisco defense, the 26-year-old Williams is well-respected in the locker room, being voted one of nine team captains last year despite having just nine career starts at the time.

ESPN 49ers reporter Paul Gutierrez and The Associated Press contributed to this report.