Terry Pegula is paying a record price for the Buffalo Bills — more than $1.3 billion, a source said.

“The price paid is well over the record amount [paid for a football team],” which was $1.1 billion in 2008 for the Miami Dolphins, a second source said.

On Tuesday, the estate of the late Ralph Wilson Jr. said it had reached an agreement to sell the team to Terry Pegula and his wife, Kim, declining to give specifics.

Fracking billionaire Pegula plans to keep the team in western New York.

“We have knowledgeable, dedicated fans here, and along with our ownership of the Buffalo Sabres, it is gratifying to reassure these great fans that two franchises so important to our region are both here to stay,” Terry Pegula said.

The NFL will allow the couple to keep ownership of both teams, a source said, because they are in the same city. League policy is not to allow owners to control more than one team in different markets.

The owners are paying more than $1 billion in cash and assuming $200 million of net debt, a source said.

Allen & Co. advised the buyers, while Morgan Stanley repped the seller.