Brian Boyle’s strong playoff wasn’t enough to keep him in New York, but it was enough to provide him with some stability and security.

Boyle, the 29-year-old forward from Hingham, signed a three-year, $6 million contract with the Tampa Bay Lightning as a free agent Tuesday. He had spent five full seasons with the Rangers, highlighted by a breakout year in 2010-11 (21 goals, 36 points) that he followed with a strong ’11-12 campaign (11 goals, 26 points).

Used primarily in defensive roles, the 6-foot-7, 244-pounder scored 18 points in 82 games this past regular season, but hit for three goals and eight points in 25 playoff contests, helping the Rangers win the Eastern Conference championship before losing to the Los Angeles Kings in the Stanley Cup Final.

Boyle was one of several players added by the Lightning, who made a surprise appearance in the playoffs this season. Tampa Bay finished second in the new Atlantic Division to the Bruins, who saw four players depart on Tuesday as free agents.

Joining Jarome Iginla (three years, $16 million from Colorado) on the way out of town were seven-year B’s veteran Shawn Thornton (two years, $2.4 million from Florida, another Atlantic Division foe), No. 2 goalie Chad Johnson (two years, $2.6 million from the New York Islanders) and defenseman Andrej Meszaros. Used infrequently after the Bruins obtained him from the Flyers at the trade deadline for a third-round draft pick, Meszaros scored a surprising $4.125 million from Buffalo on a one-year contract.