After two periods were played Thursday night at Barclays Center, with a 1-0 lead, Henrik Lundqvist bringing his A-game and plenty of scoring opportunities, the Rangers thought they were sitting pretty.

After all, the stats were on their side. Since February 2010, they were 165-1-9 when leading after two periods. “We had a really good feeling after two periods,” said Lundqvist, who had stopped all 22 shots.

Lundqvist had stopped 32 shots in his last start, a 2-1 win over the Bruins, and his mindset and confidence were growing.

“I felt like I was playing my game,” he said, “staying back and reading the shots. It’s something that I feel has been improving in the last couple of games, I’ve been watching a lot of tape.”

In the first four minutes of the third against the Islanders, however, the thread unraveled.

During a 4-on-4, Brock Nelson ended Lundqvist’s shutout bid 1:53 into the third.

“He just beat me under the glove,” said Lundqvist, who finished with 29 saves. “It was a good shot. I should’ve maybe stayed back a little bit, that’s the thing I did really well throughout of the game, I came out and challenged it too much.”

Nick Leddy’s power-play goal at 4:17 gave the Islanders a 2-1 lead and the Rangers couldn’t respond.

Lundqvist was tested early. He was forced to stop Frans Nielsen and Leddy in the first minute of the game, and denied John Tavares’ backhand at 2:39. At 10:07, he flat-out robbed Cal Clutterbuck from 10 feet with his glove and two minutes later, stopped Nikolay Kulemin’s shot through traffic. With 3:31 left, after a no-look pass from Kyle Okposo, he blocked Casey Cizikas’ one timer from the left dot and with 1:09 left, got his shoulder on Mikhail’s Grabovski’s rising shot.

But the Rangers couldn’t cash in on 14 shots in the first period against Jaroslav Halak and 13 more in the second, until Marc Staal, crashing the net, redirected Kevin Hayes’ pass with 46 seconds left in the middle period. Then the Blueshirts cracked, and once the Islanders went ahead 2-1 at 4:17 on the power play, the home team shut the door.

“They played smart,” Lundqvist said. “We didn’t have a lot of breaks the last 10 minutes.” After 11 goals in third periods in the last five games, they came up empty and fell to 7-10-3 on the road.

The Rangers visit Philadelphia tomorrow afternoon and Washington on Sunday. “There’s reasons to feel positive, but it’s disappointing,” Lundqvist said. “They came up big on their power play, now we have to move on. We have a couple big games coming up.”