BOSTON — Zdeno Chara scored the tying goal on a power play with under 3 minutes remaining in regulation and Jarome Iginla had the lone goal in a shootout to rally the Boston Bruins past the Anaheim Ducks 3-2 on Thursday night.

Carl Soderberg scored his first NHL goal and Tuukka Rask made 21 saves for the Bruins, who mustered only one shot on goal in the first period. They never sustained much of an offense but still managed to snap a two-game skid.

Devante Smith-Pelly scored less than 2 minutes into the game, Mathieu Perreault had a goal and an assist and Jonas Hiller stopped 21 shots for the Ducks. But they went 0 for 4 on the power play, dropping the league’s worst unit to 7.3 percent (4 for 55).

Bruins players came out for warmups wearing World Series caps, and the crowd cheered midway through the second period when highlights of the Boston Red Sox clinching win over the St. Louis Cardinals on Wednesday at Fenway Park were shown on the JumboTron.

Bruins team President Cam Neely and Red Sox President and CEO Larry Lucchino then came onto the ice and displayed the World Series trophy.

But despite all the excitement in the building, the Ducks were on the verge of their fourth straight victory until Patrick Maroon’s tripping penalty with 2:58 left in the third period gave Boston late life.

It didn’t take long for the Bruins to capitalize.

David Krejci slid a pass through defenseman Cam Fowler that Chara easily slipped past Hiller with 2:50 to go.

Iginla put Boston ahead in the shootout with his wrist shot over Hiller’s glove. After Rask turned aside two weak attempts by the Ducks, Ryan Getzlaf hit the crossbar to end the game.

A slap shot by Chara more than 18 minutes into the game was Boston’s lone shot of the first period. Anaheim had five shots, but needed only one to score.

The Bruins evened the score with 7:15 to play in the second when Soderberg converted a breakaway.

But Perreault’s fifth goal put the Ducks back on top with 20.9 seconds left in the period.

RANGERS 2, SABRES 0: Henrik Lundqvist made 29 saves in his 47th NHL shutout, and host New York won its second straight with a victory over lowly Buffalo.

NOTES

FLYERS-AVALANCHE TRADE: Colorado and Philadelphia swapped veteran forwards, with the Avs getting Maxime Talbot and the Flyers acquiring Steve Downie.

SABRES: Forward John Scott was suspended for seven games by the NHL on Thursday for his illegal check to Boston forward Loui Eriksson’s head last week.

CANADIENS: Hard-hitting defenseman Alexei Emelin, who’s yet to play this season due to a knee injury, signed a four-year contract extension worth $16.4 million and taking effect in the 2014-15 season.

AVALANCHE: Goaltender Semyon Varlamov will be allowed out of jail and be able to travel with the team while prosecutors consider charging him in a domestic violence case.