The Penguins' Jake Guentzel beats Capitals goaltender Braden Holtby in the second period for Pittsburgh’s first goal Tuesday night. (Gene J. Puskar/Associated Press)

For the game’s first 30 minutes, the Washington Capitals looked like the defending Stanley Cup champions, the team that won a playoff series on this ice just 10 months ago and might have to do so again this spring. But then came two disastrous minutes in which Washington unraveled like it had here in years past.

The Capitals lost to the Pittsburgh Penguins, 5-3, on Tuesday night at PPG Paints Arena, their seven-game winning streak snapped by a series of miscues in the second period that led to the Penguins scoring three times in less than two minutes to take the lead. Washington (89 points) remains in first place in the Metropolitan Division, but it lost three of its four meetings with ­Pittsburgh this season. This one felt like a present for the Penguins.

“We just give them the points, obviously,” captain Alex Ovechkin said. “We give them everything.”

With the Capitals down 3-2 entering the third period, they were assessed a bench minor for having too many men on the ice at 10:33. The Penguins’ Phil Kessel scored at 11:56 to make it a two-goal game, and center Evgeni Malkin collected his second point of the game — and the 1,000th of his career — with a secondary assist. The crowd roared its appreciation for the achievement, but then Pittsburgh was called for the same infraction just a minute later. Ovechkin set up John Carlson’s power-play goal at 14:02 to trim Pittsburgh’s lead and record a milestone of his own: his 1,200th point.

But the Capitals’ rally fell short despite the visitors putting 41 shots on Penguins goaltender Matt Murray. Jared McCann’s empty-net tally in the final minute sealed the result.

“We’ve got to be realistic, too: We just came off a seven-game win streak, so you’re not going to win all of them,” center Nicklas Backstrom said. “It’s all about how you bounce back, how you respond, and that’s what we’ve got to do on Thursday [in Philadelphia].”

The loss was made more frustrating by the fact that the Capitals were the better team for the majority of the game, keeping it simple by putting the puck behind the Penguins’ goal line as they controlled possession for the first 30 minutes. It took until the final minute of the first period for them to be rewarded: a crisp passing play put the puck on Jakub Vrana’s stick before he shot it over Murray’s glove and just under the crossbar. After the players celebrated the tally, which gave Washington a 1-0 lead at 19:27, forward T.J. Oshie asked the official for the puck as a keepsake for Vrana. The 23-year-old had recorded his first 20-goal season — in just his second full year in the league.

Vrana blew right past that milestone 10:24 into the second period when his shot from the right faceoff circle popped over Murray, the puck landing on his back before dropping into the net to lift the Capitals to a 2-0 lead. Washington was executing its game plan perfectly, managing the puck well and making few mistakes. But one gaffe just two minutes after Vrana’s tally turned the game on its head.

“That was a game we were fully in charge of,” Capitals Coach Todd Reirden said. “We make mistakes, and they’re able to convert back the other way.”

McCann swiped the puck from center Evgeny Kuznetsov as he was casually carrying it out of the defensive zone, and the turnover led to a two-on-one for McCann and Jake Guentzel, with the latter scoring his 35th goal of the season at 12:37. That wouldn’t have been disastrous had the Capitals stopped the bleeding, but less than a minute later, Penguins defenseman Justin Schultz flipped the puck down the ice for captain Sidney Crosby, who outmuscled defenseman Michal Kempny. Goaltender Braden Holtby played it aggressively, coming forward in the crease, and Crosby jammed the puck through his legs to tie the score at 13:24.

“At first, I didn’t think it was going to be a breakaway, so I was kind of playing it a little more as if it was going to be a battle or quick shot,” Holtby said. “I got kind of flat-footed.”

Thirty-one seconds later, Backstrom went to the penalty box for tripping Malkin, putting the Penguins on the power play when they already had all of the momentum. Dropping to one knee, Crosby one-timed the go-ahead goal at 14:25, capping Pittsburgh’s three-goal outburst in 1:48.

“We let it slide too far and too fast,” Carlson said. “Stuff’s going to happen throughout a game, especially against a really good team. You just want to negate their momentum as much as you can, and we didn’t do that.”

These clubs have won the Stanley Cup each of the past three years, having to first get through the other on the way, and every game between them is a mini-drama. When Pittsburgh won its back-to-back championships in 2016 and 2017 with speed, Washington tweaked its roster to get faster. After the Capitals won last season in large part because their physicality wore opponents down, the Penguins added to their toughness this year, bringing in defenseman Erik Gudbranson and center Nick Bjugstad.

Entering this game, the teams were poised for a first-round playoff matchup against each other, but the win pushed Pittsburgh to third place in the division for now. And while Tuesday’s whirlwind contest was the teams’ last meeting of the regular season, they could very well see each other again soon.

“I think it’s not frustrating, but it’s good lessons before playoffs, obviously,” Ovechkin said. “It’s bad when we didn’t get any points from that, but from that standpoint, we have to realize how we have to play. We have to play smarter. We get 2-0 middle of the second, and we make bad decision and it’s in the back of our net. Learn from that, and move on.”