BUFFALO, N.Y. (AP) The Buffalo Bills are giving oft-injured cornerback E.J. Gaines a third opportunity to resume his career by agreeing to a one-year contract on Thursday.

Buffalo also agreed to sign offensive lineman Daryl Williams, who played mostly tackle during his previous five seasons with the Carolina Panthers. Williams' addition provides the Bills experienced depth and has the potential of having returning starter Cody Ford make the switch to right guard.

Ford started 15 games during his rookie season at right tackle, but coach Sean McDermott hasn't ruled out the possibility of him shifting positions. Williams started 41 games for Carolina and is also familiar to McDermott and Bills general manager Brandon Beane, after the two previously worked for the Panthers before arriving in Buffalo in 2017.

For Gaines, this marks the second consecutive offseason he's signed with Buffalo. He then missed all of last season after sustaining a core muscle injury during training camp.

Buffalo first acquired Gaines in a trade that sent receiver Sammy Watkins to the Los Angeles Rams in the summer of 2017. He started 11 games with the Bills that year, playing alongside rookie Tre'Davious White.

The 28-year-old Gaines is familiar with Buffalo's defensive system, which hasn't changed since McDermott took over in 2017. His addition provides the Bills depth in their backfield, which now includes veteran Josh Norman.

Gaines has five seasons of NFL experience, including an injury-shortened six-game stint with Cleveland in 2018.

Overall, he has four interceptions and four forced fumbles in 48 games, including 38 starts.