Alexander Semin, right, and Matt Hendricks celebrate after Semin's goal against the Philadelphia Flyers in the shootout. (Matt Slocum/AP)

On one hand, the Washington Capitals coughed up a three-goal lead on Tuesday night after sitting back against the Eastern Conference-leading Philadelphia Flyers. But on the other, the visitors managed to mount a comeback of their own and escape the hostile environment with two points to seal a fourth consecutive playoff berth.

After allowing the Flyers to score four consecutive goals in the final two periods to take a lead with less than six minutes remaining in regulation, the Capitals regained their composure, tied the game and forced overtime and a shootout. Each Washington shooter — Matt Hendricks, Nicklas Backstrom and Alexander Semin — beat Philadelphia goaltender Brian Boucher to clinch a dramatic 5-4 win in the final tiebreak session.

With its 13th victory in the last 15 outings, Washington improved to 96 points but still trails the Flyers, who have two games in hand, by one for the top spot in the conference.

While the Capitals were hardly flawless at Wells Fargo Center in guaranteeing the largely assumed trip to the postseason, they’ll take it, along with a reminder about heightening focus when they hold a large lead rather than letting up.

“We were a little lucky there the first period,” said Backstrom, who recorded a pair of points in addition to his shootout marker. “I think they came out harder in the second period and they worked us down low and I think from there it was tough for us. At the same time I think it’s strong of us that we find a way to get back in games when they score four straight goals here.”

In the Capitals’ first game without captain Alex Ovechkin, whom the team announced on Monday would miss seven to 10 games days with an undisclosed injury, they came out determined to not miss a beat. The Capitals chased Flyers netminder Sergei Bobrovsky from the net less than 22 minutes into the contest by scoring three goals on nine shots against the 22-year-old Russian rookie.

Backstrom started the barrage when his wrister squeezed between Bobrovsky’s torso and blocker. Former Flyer Mike Knuble made it 2-0 with less than three minutes remaining in the first from his wheelhouse in the crease for his 20th goal of the season. It’s the eighth consecutive year the veteran right wing has posted 20 or more goals. Early in the second, Dennis Wideman scored his first goal as a Capital with a shot from the point on the power play to gave Washington a three-goal cushion.

Wideman’s tally prompted the Flyers to remove Bobrovsky and install Boucher, a change that sparked the rest of their lineup. The Flyers’ usual trademarks of booming hits and play down low started to shift the momentum in their favor and bring cheers from the previously booing sellout crowd.

Washington didn’t respond well to that initial surge and that is perhaps the biggest lesson the Capitals can learn, Knuble said.

“We let them back in the game and just kind of sat back and figured they would just play it out,” Knuble said. “Then the momentum starts, you’re playing on the road and that’s when you’ve got to work harder at that point, when you’re up 3-0. You’ve got to really play even better, even harder, even more deliberate and take care of the puck even better, and that’s something that we kind of took a step back.”

Kris Versteeg cracked Michal Neuvirth, who finished with 29 saves, when a pass deflected off Wideman’s skate and crossed the goal line. With only 33.8 seconds remaining in the second period, Claude Giroux cut the Capitals’ lead to one after a defensive breakdown. With 9 minutes 58 seconds elapsed in the third period, Andreas Nodl knotted the score at 3 after a giveaway by Jeff Schultz. Danny Briere made the Flyers’ comeback complete with a tip-in to make it 4-3 at 14:15 of the third.

Somehow, the Capitals found the mettle to not cave in. Marcus Johansson rifled a shot past Boucher with slightly more than three minutes remaining in regulation to send the game into overtime and eventually the shootout. Washington’s ability to bounce back in the face of a Flyers squad with plenty of snarl and momentum, with 19,893 fans roaring along with it, was what Coach Bruce Boudreau believed was the crucial element of Tuesday night.

“A team comes back and scores four goals and gets the lead and you have the character that doesn’t quit,” Boudreau said. “I think most teams would say: ‘Oh my goodness.’ In this building, as loud as it was with all the momentum — we weren’t getting any shots — and we came back. . . . To have the wherewithal to come back in a game like this was important to us.”