The Ottawa Senators traded winger Mike Hoffman on Tuesday, hoping to solve an ugly off-ice issue involving star defenseman Erik Karlsson and his wife.

The Senators sent Hoffman to the San Jose Sharks, who then dealt him to the Florida Panthers. All told, the two transactions involved four players and six draft picks.

The Sharks sent forward Mikkel Boedker, defensive prospect Julius Bergman and a 2020 sixth-round pick to the Senators for Hoffman, defensive prospect Cody Donaghey and a 2020 fifth-round pick. They then dealt Hoffman and a 2018 seventh-round pick to the Panthers for 2018 fourth- and fifth-round picks and a 2019 second-round pick in a move that clears significant cap space for San Jose to use in an offseason that includes potential free agent forwards John Tavares and Ilya Kovalchuk.

The Senators were eager to deal Hoffman amid a dispute with team captain Karlsson and his wife. Melinda Karlsson recently filed an order of protection against Hoffman’s fiancee alleging harassment and cyberbullying in the form of hundreds of derogatory online messages aimed at her and her husband, whose first child, a boy, was stillborn in March.

Ottawa general manager Pierre Dorion didn’t hide his reasoning for trading Hoffman.

“Today’s trade showcases our determination to strengthen the future of the team by improving chemistry, leadership and character in the locker room and on the ice,” Dorion said. “We are confident it is a step in the right direction for the long-term success of this organization.”

The Senators may still trade Karlsson, who can be a free agent at the end of next season, but shipping Hoffman addressed an immediate problem. Dorion contacted the Panthers about Hoffman last week, but Panthers GM Dale Tallon said the players Ottawa was looking for didn’t make it a match.

The Panthers were still interested in Hoffman and made a deal with the Sharks for the speedy winger who can score at a reasonable price without having to trade from their NHL roster. Hoffman has surpassed 20 goals in each of the past four seasons since becoming a full-time NHL player.

“We felt that this would be a perfect fit for our team,” Tallon said. “He’s 28, he can score, he can skate, he’s got a cannon for a shot. He’ll be a good fit for our team moving forward. We missed the playoffs by a point. I thought that we needed to add some offense and some speed and skill to our lineup, and this turns out to be the fit for us.”

Tallon said he was confident Florida’s locker room would accept Hoffman and wasn’t worried about the situation in Ottawa being a problem.

“We did our homework and we discussed it with a lot of different people,” Tallon said. “We feel that that’s in the past and the distractions. We’re very confident that he’ll be embraced by our team and by their wives and girlfriends. We have a strong culture down there now and I think talking with Mike and all the parties that it will work out to our benefit.”

The Sharks, who paid a bargain-basement price to acquire scoring winger Evander Kane at the trade deadline when Buffalo was eager to deal him, shed Boedker’s $4m salary-cap hit over the next two seasons and cleared room to make some splashes this summer.

“We have witnessed some tremendous growth in our younger forwards over the past season and we feel that we have another group of players that are ready to challenge for additional ice time,” Sharks GM Doug Wilson said. “These transactions have also allowed us to add to our pool of draft selections, as well as free up a substantial amount of cap space for internal and external player options in the coming months.”