It was not a beautiful game and it did not need to be. For the Capitals, who twice blew third-period leads in recent days and left games with nothing, a win was the best way to forget a difficult week.

Nicklas Backstrom, Troy Brouwer and Wojtek Wolski helped Washington shake off a second-period deficit to the Philadelphia Flyers and this time it was able to close the game out successfully in the final minutes of a 3-2 victory at the Verizon Center on Friday night.

The win snapped a two-game losing streak after disastrous third periods against Ottawa on Tuesday and Toronto on Thursday. Caps coach Adam Oates deadpanned that he could have used less stress against the Flyers, but would take it.

“It’s been a few games coming,” Oates said. “But the guys hung in there and played very good hockey again tonight. It’s very encouraging.”

Washington (2-5-1, five points) jumped the Flyers (2-6-0) and the Florida Panthers (2-5-0) in the Eastern Conference standings. The Caps are still only in 13th place overall, but just three points out of a playoff position with a much-anticipated game against the Pittsburgh Penguins at home on Super Bowl Sunday.

“Sometimes you get discouraged when you’re doing the right things and you don’t get rewarded,” Wolski said. “I think that’s when perseverance comes in. That’s pretty much the definition right there is when you work hard and things don’t go your way and you keep pushing. We seemed to do that tonight.”

The game wasn’t without controversy. At 18:09 of the first period, Caps defenseman John Erskine stuck out his right elbow and smashed it into the jaw of Flyers forward Wayne Simmonds. Erskine escaped without a penalty, but Simmonds was knocked woozy and had his nose bloodied. He eventually skated off the ice under his own power, but Erskine may have to answer from the league office.

“It looked dirty when I first saw it,” Philadelphia coach Peter Laviolette said. “Tough hit.”

Teammate Matt Hendricks had to answer on the ensuing shift. The linesman double-pumped before dropping the puck on the ensuing faceoff and Hendricks and Flyers forward Zac Rinaldo began throwing punches before play started. That’s a no-no. Both men were handed game misconduct penalties and ejected.

Afterwards, the Flyers controlled the game for a time. They finished the first period with nine of the last 10 shots on goal. In the second period they took the lead at 11:43 when Bruno Gervais smashed home a loose puck in front of goalie Braden Holtby (29 saves). Defenseman Karl Alzner lost his man in front and when partner Mike Green lunged over to push the puck away it deflected right to Gervais who occupied the space Green had just abandoned. It didn’t help that the three Washington forwards on the ice weren’t exactly helping Green and Alzner do battle down low.

But while Philadelphia controlled the territorial edge, a costly mistake led to the tying goal. Defenseman John Carlson made a nice play to poke the puck away from onrushing forward Sean Couturier and with Philadelphia in the midst of an ill-timed line change, Backstrom skated onto it freely at center ice. He even had time to check behind him, see that there was plenty of time and slowed as he approached the goal before deking to his forehand and then roofing a backhand over goalie Ilya Bryzgalov’s shoulder.

“We created a lot of turnovers and got a lot of shots — quality chances rather than just puck possession,” said Green, who later assisted on Brouwer’s goal with a pretty cross-ice pass from high to low. “

The Flyers then fell apart late in the second, taking a too-many-men-on-the-ice penalty when seven of them were on at the same time. A Kimmo Timonen cross-check just before the final horn put Philadelphia down two men for 1:12 to start the third period on a fresh sheet of ice — though they escaped after an ugly 5-on-3 from Washington.

Brouwer’s goal on that pass from Green made it 2-1 at 3:57 of the third. Wolski later had a breakaway goal of his own — another backhander past Bryzgalov — after stealing the puck in the neutral zone following a Flyers’ faceoff win. That insurance goal came at 6:44 and proved to be the game winner. Philadelphia cut the advantage to 3-2 just 3:46 later when a Matt Read shot hit both the left and right post and bounced in front to Brayden Schenn, who beat Holtby on the rebound.

“We had a tough road trip,” Backstrom said. “We played well against Ottawa and we had a lead there in the third period — same thing in Toronto. So we really needed this one. Especially the position that we are in. We need the points.”