With a one-goal lead after two periods Thursday night at Barclays Center, Henrik Lundqvist displaying his A-game and plenty of scoring opportunities, the Rangers thought they were sitting pretty.

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 to that point.

Lundqvist stopped 32 shots in his previous start, a win over the Bruins, and his confidence was 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 period Thursday night, however, the thread unraveled in the Rangers’ 3-1 loss to the Islanders.

advertisement | advertise on newsday

During a four-on-four, 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 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 robbed Cal Clutterbuck from 10 feet with his glove and stopped Nikolay Kulemin’s shot through traffic two minutes later. After a no-look pass from Kyle Okposo, he blocked Casey Cizikas’ one-timer from the left dot with 3:31 left. With 1:09 remaining, he 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 after the Islanders went ahead, 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 previous five games, they came up empty and fell to 7-10-3 on the road.

The Rangers visit Philadelphia on Saturday for a 1 p.m. game and play at Washington at 5 p.m. 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.”