PHILADELPHIA – From a statistical perspective, the outcome was almost a foregone conclusion. The Flyers had won three games in a row, and the Anaheim Ducks had lost five straight.

When the teams met at Xfinity Mobile Arena on Saturday afternoon, the numbers finally caught up to the home team.

Leading by two after one period, the Flyers let the Ducks score five of the next seven goals in a 5-4 loss, ending Philadelphia’s recent run of productive play.

A goal by the Ducks’ Tristan Luneau two minutes into the third period broke a 3-3 tie. Luneau fired a shot from the lower right circle past goaltender Joseph Woll. That was followed by a goal from Beckett Sennecke at 7:10.

Matvei Michkov scored his second goal of the game and eighth of the season at 8:17 to get the Flyers within one. But the Flyers couldn’t get the equalizer, even with a power play near the end of the game.

Although they scored two power-play goals in a game for the first time this season, they finished 2-for-7, which wasn’t quite good enough for coach Rick Tocchet.

“It’s been improving, that’s a positive,” Tocchet said after the game. “We have to keep working at it but I thought the puck movement, there were good chances.”

The coach said the Flyers sort of let this one get away after dominating in the first period.

“I thought we had them,” Tocchet said. “After a really good first. We let them back in the game. We tried at the end.”

Tocchet also said the Flyers took penalties at inopportune times, which has been a tendency this season. When his players take questionable hits, he doesn’t want them to respond irresponsibly.

“There are just some penalties I want us to stop doing,” Tocchet said. “I get it, when guys get hit, if you get hit, so what? Back in the day we used to do all that stuff. I don’t think you can do that nowadays. You know, take the guy’s number, do it a different way. I’d like us to be a little more disciplined.”

After starting taking the two-goal lead into the first intermission, the Flyers unraveled in the second period.

Anaheim started to rally when Cutter Gauthier, a former Flyers first-round draft pick, found Leo Carlsson in front for a shot over a sprawling Woll at 7:38 to make it 2-1.

The Ducks tied it when A.J. Greer’s shot hit the right post, ricocheted off Woll’s skate and barely slid across the line at 13:07. The play was confirmed on review.

The Flyers tied it on their first shorthanded goal of the season. Tyson Foerster skated to the lower right circle and his shot somehow eluded goalie Lukas Dostal at 15:04.

The Ducks, however, had more tricks in their bag and they used one at 16:07. Sean Couturier was slow on the backcheck as Alex Killorn raced in and got the puck to Judd Caufield for a flip over Woll’s pad.

The Flyers connected on a pair of power plays in the first period when the Ducks received a pair of concurrent minors. First, Flyers defenseman Hunter McDonald totaled A.J. Greer with a check along the boards.That instigated the Ducks’ Sam Colangelo to go after McDonald.

In the ensuing five-on-three, Michkov sent a screened shot past Dostal at 13:59.

With the Flyers still up a man, they struck again. Travis Sanheim rushed down through the left circle and found Porter Martone in front for a short shot into the net at 15:02.

“We came out hot, the crowd’s amazing,” Martone said. “We’re up 2-nothing going into the second period. I liked our bounce-back in the third but that one definitely stings to blow that one and lose by one goal.”

The Flyers still have work to do on the power play. They entered Saturday’s play 26th in the league at 13.9 percent.

“I think just moving the puck, keeping it simple, getting a lot of shot volume,” Martone said. “l know it’s going to come. I like our tenacity, I like our shooting pucks. Hopefully capitalize on the next important one.”

Notes: After missing nine games due to a hand injury, Rasmus Ristolainen returned to action. He partnered with Hunter McDonald on the third pairing. To make room, Garrett Wilson was loaned to the Phantoms. … Gauthier, who basically talked his way out of town, continues to hear it from the Philly fans. As soon as he hit the ice, the crowd started into a chant which can’t be reprinted here. … The Flyers are off until Tuesday when they host the Columbus Blue Jackets followed by a game at Washington Wednesday. … Martone’s multi-point game was the fifth of his career.