The Flyers sent the 14th overall pick in Friday night's NHL draft, their second-round pick in 2023, and defenseman Robert Hagg to the Sabres.
Ristolainen, 26, has played all eight years of his NHL career with the Sabres, who selected him eighth overall in 2013. He has 245 points in 542 career games. Last season, he had four goals and 14 assists in 49 games, averaging 22 minutes and 17 seconds in ice time per game.
"We certainly look at Ristolainen as someone who can be a big part of our future going forward,'' Flyers general manager Chuck Fletcher said. "We like our defense core. We felt like we had good pieces. But we lacked size and physicality on the back end.''
Hagg, 26, played five years with the Flyers. He had five points in 34 games last season, averaging 15:40 in average ice time. The Sabres had been seeking a trade for Ristolainen, who has one more year on his contract with a $5.4 million cap hit before he hits unrestricted free agency. The asking price had been a first-round pick and other assets.
Buffalo now has seven picks in the first 100 selections in this weekend's NHL draft, including two first-rounders. The Sabres are picking first overall and then taking the 13th player in the draft, as the Arizona Coyotes have to forfeit pick No. 11 and the Sabres now own the 14th pick.
The trade marks the third transaction Fletcher has made in less than a week involving his blue line. The Flyers acquired Ryan Ellis from the Nashville Predators for center Nolan Patrick and defenseman Philippe Myers; and traded defenseman Shayne Gostisbehere to the Arizona Coyotes with two draft picks in a salary dump.
Ristolainen said he is looking forward to a fresh start in Philadelphia, which missed the playoffs last season following a second-half collapse.
"We had really tough years in Buffalo. I played a big part. I was one of the leaders there and we couldn't make the playoffs,'' he said. "I'm very excited to go to Philadelphia. I'm going to do anything I can to make the playoffs and make a run there.''
The Associated Press contributed to this report.