Mario Williams, the free agent defensive end and outside linebacker who is a former top overall selection in the NFL draft, agreed Thursday to a six-year contract with the Buffalo Bills.

The Bills scheduled a 1:45 p.m. news conference to announce the deal.

A person familiar with the negotiations said Williams’s contract could be worth as much as $100 million, including $50 million in guaranteed money. It is the richest in NFL history for a defensive player, surpassing the $42 million in guaranteed money that defensive end Julius Peppers received from the Chicago Bears.

Williams spent six seasons with the Houston Texans after being chosen with the top pick in the 2006 draft. He had 53 sacks in those six seasons, including a career-best 14 in 2007. He had five sacks in five games in an injury-shortened 2011 season.

“This is a great day for the Buffalo community, the Bills organization [and] our fans!” the team’s chief executive officer, Russ Brandon, wrote on Twitter.”