Davis' one-year deal with the Bills will pay him $5 million with playing-time incentives that can increase it to $8 million, a source said. The deal includes $3.5 million guaranteed. NFL Network first reported Davis' compensation Tuesday.
Davis announced his decision in a tweet Monday evening after visiting several teams over the past two weeks.
Davis was medically cleared earlier this month following core injury surgery that was performed late last season.
The Bills' signing of Davis means they will not be expected to re-sign starting cornerback E.J. Gaines when he becomes an unrestricted free agent March 14.
Davis, 29, was released by the Indianapolis Colts on Nov. 9 after he sought additional medical opinions and opted to have season-ending surgery. The Colts made an announcement that Davis would not make the trip with the team on the Saturday before Indianapolis' Week 9 game against the Houston Texans, saying the decision wasn't related to an injury.
Before he was released, Davis said he felt disrespected when the Colts left him behind. He said he hadn't played well in 2017 because he was still dealing with the groin injury he suffered against Pittsburgh in the third preseason game, which caused him to miss the first three weeks of the regular season.
In 120 career games spanning nine seasons with the Colts and Dolphins, Davis, a two-time Pro Bowl selection, has made 112 starts with 395 tackles, 22 interceptions and 106 passes defensed.
ESPN's Mike Wells contributed to this report.