The Sabres received a 2022 sixth-round pick, which was previously acquired from the Calgary Flames in the Sam Bennett trade.
“Robert is a tireless competitor and a physical defenceman who will add depth to our blue line,” said Panthers GM Bill Zito.
Florida is also expected to place defenceman Aaron Ekblad on the long-term injured reserve to clear enough cap space.
The move comes a day after Florida landed former Philadelphia Flyers captain Claude Giroux in a blockbuster deal.
Hagg, 27, was drafted in the second round, 41st overall, by Philadelphia in 2013, and played five seasons with the Flyers until he was traded to the Sabres during an offseason deal last summer along with draft picks for Rasmus Ristolainen.
The Swedish rearguard has eight points (one goal and seven assists) in 48 games this season. He is set to become an unrestricted free agent at the end of the season earning $1.6 million this season, according to CapFriendly.