ANAHEIM, CALIF. - The Anaheim Ducks snapped their seven-game losing streak with a gritty victory over Montreal.

And it wasn't enough to save coach Randy Carlyle's job.

An hour after Corey Perry and captain Ryan Getzlaf each had a goal and two assists in a 4-1 victory over the Montreal Canadiens on Wednesday night, the Ducks fired the coach who led them to their only Stanley Cup title in 2007, replacing him with former Washington coach Bruce Boudreau.

Boudreau was fired by the Capitals just two days earlier.

Jonas Hiller made 19 saves, rookie Devante Smith-Pelly scored a power-play goal, and Niklas Hagman added an empty-netter for the Ducks, who killed seven penalties in just their third victory in 19 games since mid-October. Anaheim hadn't won since Nov. 11, the tension increasing with every loss.

"This was an extremely difficult decision," Ducks vice president and general manager Bob Murray said in a statement. "Randy is a terrific head coach, and did a tremendous job for us for six-plus seasons.

"At this time, we simply felt a new voice was needed. Bruce is a proven winner with a great track record, and we are optimistic we can turn this season around under his leadership."

Carlyle clearly didn't know he was about to be fired when he addressed the media after the game, expressing relief his club had turned a corner.

"We did a lot of things to a higher level than we have in the past few games we've played," Carlyle said. "That is what it takes to win. We can't overemphasize, our captain stepped up big-time, Corey Perry stepped up big-time, our penalty killers stepped up and our goaltender stepped up. Our effort from our group was closer to the 60-minute mark than we've been in a while. They went out and earned it."

Carlyle is the fourth NHL coach to be fired this season, and the third this week.

The Ducks avoided an eight-game slump, which would have matched the longest in franchise history, with offensive leadership from Perry and Getzlaf, the longtime linemates and Canadian national teamers. Anaheim had lost eight of nine at Honda Center, but played solid defense in front of Hiller for just its second home win since Oct. 16.

"We were playing with the puck more," Perry said. "It's all confidence when you're playing with the puck and hanging on to it. We got behind early, and we didn't let it phase us. We stuck to our game plan and got on the forecheck."

Bobby Ryan, the subject of numerous trade rumors in recent days, received an ovation when he was introduced in the Ducks' starting lineup. The American forward assisted on Smith-Pelly's goal, but he has just two goals in 11 games while getting dropped from his position alongside Perry and Getzlaf on the Ducks' top line.

The Ducks didn't make a panic trade of their young talent. Instead, they hired new tutors for that talent.

Boudreau was fired by the Capitals on Monday after four seasons, leading them to four division titles and a Presidents' Trophy while winning the 2008 Jack Adams award as the league's top coach. Anaheim planned to introduce Boudreau at a news conference on Thursday.

Andrei Kostitsyn scored a first-period goal and Peter Budaj stopped 23 shots for the Canadiens, who opened a three-game California road trip with their third straight loss. Montreal played without goals leader Max Pacioretty, who served the first game of his three-game suspension for a hit to the head of Pittsburgh defenseman Kris Letang.

"They're a desperate team, and they have some skilled players that made plays," Montreal defenseman Hal Gill said. "We couldn't get the job done on the power play, and we gave up a couple of goals short-handed. It's tough to win when you do that."

The Canadiens went ahead in the opening minutes when Tomas Plekanec fed Kostitsyn for his first goal since returning from a 10-game injury absence. Anaheim skated in its now-usual fog during the first period until it was forced to kill three consecutive penalties, energizing the bench and the building by shutting down the NHL's 29th-ranked road power play.

"The fact that we had three power plays and didn't score and didn't have a lot of chances, that probably turned the momentum of the game," Montreal coach Jacques Martin said. "They won the special teams part of the game and scored two on the power play, and that was the difference. We've got to be better that way."

Getzlaf evened it when Perry found him with a cross-ice pass with 19 seconds left in the first period. Although he has a seven-game assist streak, the Anaheim captain hadn't scored a goal in 14 games since Oct. 27 -- a fact mentioned to him that morning by Perry.

Anaheim failed to score during a 90-second, two-man advantage early in the second period, but Smith-Pelly put the Ducks ahead moments later when he alertly swatted a rebound onto the ice and smacked it past Budaj. Perry added another power-play goal early in the third, expertly redirecting Francois Beauchemin's shot for the reigning NHL MVP's 11th goal.

Hagman added his first goal since joining the Ducks two weeks ago, scoring with 1:29 to play.

NOTES: Anaheim is 5-0-1 in its last six games against Montreal. ... Longtime former Montreal captain Saku Koivu played his third game against the Canadiens since moving to Anaheim. Koivu was the Habs' captain for 10 of his 13 seasons in Montreal, matching Jean Beliveau for the longest captaincy in franchise history. ... Montreal D Andrei Markov traveled to California, but didn't make his return from a yearlong absence with torn ligaments in his right knee. Markov, who hasn't played since Nov. 13, 2010, could return later on the trip in San Jose or Los Angeles.