Updated

Alexander Semin completed his seventh career hat trick by scoring the tying and go-ahead goals in the final minutes, and the Washington Capitals dramatically rallied to snap their three-game skid with a 7-6 victory over the Anaheim Ducks on Wednesday night.

Semin tied it with 8:23 to play and put the Capitals ahead with 1:47 left, ending the supremely streaky scorer's 17-game goal drought. The Russian scored 18 goals with three hat tricks in the Capitals' first 25 games, but hadn't scored since Nov. 28 while missing 15 games with injuries.

Ryan Getzlaf and Corey Perry had a goal and three assists apiece for the Ducks, whose four-game winning streak ended despite an offensive barrage in their highest-scoring game in a month.

Washington still rallied against shaky Anaheim backup Curtis McElhinney, who made just 24 saves while filling in for ailing All-Star Jonas Hiller.

Alex Ovechkin had an early goal and an assist for the Capitals, who gave up six goals for the first time since Nov. 26 on the second stop of a five-game road trip.

Michal Neuvirth stopped just nine shots in the final two periods after Semyon Varlamov was pulled by Capitals coach Bruce Boudreau for yielding three goals on nine shots in the first period.

Brooks Laich, Mike Knuble and David Steckel also scored for Washington.

After Bobby Ryan put the Ducks ahead 6-5 early in the third period on a break with Perry and Getzlaf, Semin evened it on a rebound when an awkward shot forced McElhinney to deflect a puck with his shoulder. In the final minutes, Semin forced a turnover in the corner, skated unimpeded to the net and flicked a backhand home.

Teemu Selanne scored in his third straight game, Toni Lydman scored his first goal since Oct. 17, and Lubomir Visnovsky also scored for Anaheim, but the Ducks blew a chance to move into first place in the crowded Pacific Division in their only home game in a three-week stretch.

Getzlaf played his first home game in more than two months after missing 14 games with broken bones in his face, and defenseman Francois Beauchemin returned to Anaheim for the first time since the Ducks reacquired the veteran defenseman in a trade last week.

Washington played without star defenseman Mike Green, who missed his second straight game with an apparent head injury. He also missed a game earlier in the month after getting hit in the head with a puck on Feb. 6.

Perry scored his 29th goal short-handed, putting the Ducks ahead 4-2 in the second period. After a tongue-lashing from Boudreau during a timeout, Washington promptly tied it with goals from Steckel and Semin.

Visnovsky put the Ducks ahead late in the second period with his 400th NHL point, but Knuble tied it early in the third with a breakaway goal when Visnovsky fell down while chasing him.

NOTES: Before the game, Anaheim put Hiller on the injured list with a recurrence of the dizziness and fatigue that has plagued him since All-Star weekend. Hiller has played just one full game in February, shutting out Edmonton last Sunday. The Ducks recalled prospect Timo Pielmeier from the ECHL to back up McElhinney. Pielmeier has never played in an NHL game. ... Ovechkin's goal was his 22nd, but just his third in nine games. ... Getzlaf is wearing a visor, which likely would have protected him from the deflected puck that hit him in the face on Dec. 28 at Phoenix.