WASHINGTON, DC - MARCH 25: Goalie Braden Holtby #70 of the Washington Capitals tends the net against the Arizona Coyotes during the third period at Verizon Center on March 25, 2017 in Washington, DC. (Photo by Patrick Smith/Getty Images) (Patrick Smith/Getty Images)

First, it was Daniel Winnik who celebrated by running into the referee along the glass, stumbling to the ice before a Washington Capitals teammate happily lifted him up. Justin Williams triggered the goal horn next, and his celebration was more subdued, with other red jerseys circling him for a group hug. Then it was Winnik again, falling in front of an empty net as he swung his stick to push the puck into it.

After Washington’s offense was suffocated for most of the game, the Capitals finally got rewarded late in the third period with a flurry of goals. They beat the Arizona Coyotes, 4-1, for their 31st win at home, a franchise record. That also kept the Capitals atop the Metropolitan Division.

But there also was a lesson in how Washington handled an inferior opponent, first in granting Arizona hope by not making the deficit more substantial sooner and then in responding once the score was tied late in the third period.

“It was stressful,” Coach Barry Trotz said.

“These last few games, they’re important for our psyche,” Williams said. “They’re important certainly for us to get first in our conference and first in the league — that’s what we’re obviously striving for — and for our confidence, to know that we can win one-goal games, to know that we can win coming from behind, to know when the game is going into the third, we can win it. These are all things that are essential.”

After the Capitals got an early power-play goal from Alex Ovechkin, they were unable to distance themselves from the Coyotes despite being the better team for the majority of the game. Clinging to a 1-0 lead with less than 10 minutes left in the third period, Washington got another opportunity with a power play, but the man-advantage didn’t record a single shot on goal.

Shortly after it expired, Arizona’s Anthony Duclair beat Washington’s John Carlson to a puck, then raced past him in open ice to get a shot on goaltender Braden Holtby. Holtby slid to make the pad save, but Peter Holland punched in the rebound to tie it.

That seemed to awaken the Capitals, who answered with three quick goals.

“We certainly knew what was happening,” Williams said. “We were letting them hang around, and then it’s what happens. It just takes one. It just takes something to happen for them to say, ‘You know what, we can win this game.’ I thought we started well, but we weren’t able finish. It’s certainly something we need to work on but something we can learn from and something that I know that we knew was occurring at the time.”

Washington’s opponents this month have been teams either fighting for playoff position or still trying to secure a postseason berth. That has made for some desperate competition — but it wasn’t the case Saturday night. Arizona, one of the worst teams in the league, had nothing to play for. The Capitals, meanwhile, remain desperate for points as they pursue the top seed in the Metropolitan Division.

The Capitals responded accordingly, getting off to a strong start with a 12-3 lead in shots after the first period. The Coyotes’ shot count stayed stuck on three until 6:32 into the second period, when a dump in from the neutral zone bounced off Holtby. With 12:29 left in the first period, Ovechkin drew a hooking penalty by defenseman Alex Goligoski, and then Ovechkin wristed a puck past goaltender Mike Smith to lift Washington to an early lead.

That goal was his 30th of the season, making him just the third player in NHL history with 30 goals in his first 12 seasons, joining Mike Gartner and Wayne Gretzky. After the game, Trotz told Ovechkin about the accomplishment, made sweeter with the team’s fourth straight win.

“If you think about it, some history was made tonight,” Trotz said.

“It’s nice to be in history,” Ovechkin said. “But more history to come.”