Nicklas Backstrom, right, celebrates with Michal Kempny after opening the scoring in Saturday’s win at San Jose. (Lachlan Cunningham/Getty Images)

Having scored one goal across the first 120 minutes of their three-game swing through California, the Washington Capitals seemed determined to change their fortunes Saturday afternoon against the San Jose Sharks.

They controlled the majority of the play. They created most of the chances. But as the second period wound down, they found themselves in a scoreless tie with the Sharks.

Nicklas Backstrom snapped the tie with just 88 seconds left in the second period, taking a cross-ice pass from Brett Connolly and slamming in a slap shot over the right shoulder of Sharks goaltender Martin Jones and into the top of San Jose’s net.

“I saw a little spot over his shoulder,” Backstrom said later, “so I took it.”

That would prove to be all the Capitals needed.

Thanks to a strong performance from backup goaltender Philipp Grubauer, who pitched Washington’s first regulation shutout of the season in his second straight start in place of struggling Braden Holtby, the Capitals claimed a 2-0 victory over the Sharks at SAP Center, snapping their two-game skid and ensuring they wouldn’t leave the Golden State empty-handed.

“When you’re playing really well and you have a lot of [offensive] zone time, you want to get rewarded for it,” Coach Barry Trotz said. “That’s the mental thing. You always talk about, ‘Play the right way, stay to the process, stay to the plan.’ . . . What happens when you keep getting zone time and chances and you don’t score, then you start to cheat in areas. And, first thing you know, it’s coming down your throat the other way, and you’re giving up a goal.

“I liked our patience and staying on task in what we needed to do. Play the right way and not get impatient, and, at the end of the day, we did that and we got a result that I thought we deserved.”

The Capitals got that result primarily because of Grubauer. With Holtby being pulled in the second period of Tuesday’s loss in Anaheim, Trotz opted to give Grubauer a second straight start to allow his starting goalie a chance to work on his game and clear his mind.

But in addition to giving Holtby a much-needed break, Grubauer also gave the Capitals the kind of performance they desperately needed in a third straight game in which they struggled to score.

In a tight game that only featured two penalties — both committed by Capitals forward Tom Wilson — San Jose had a couple of golden opportunities, with clear-cut chances coming for center Chris Tierney in the first period and defenseman Brenden Dillon in the third, plus a sequence with 5:31 to go when the puck bounced around on top of Washington’s net before harmlessly falling to the side.

But Grubauer was up to the task of stopping them all, and he coolly protected the lead after Backstrom’s bullet from the left wing.

Lars Eller added an empty-net goal with 1:49 remaining to move Washington back into first place in the Metropolitan Division, one point ahead of the Pittsburgh Penguins after their 5-2 loss at the Toronto Maple Leafs on Saturday night.

“I take it game by game,” said Grubauer, who has Washington’s other shutout this season — a 1-0 shootout loss in New York against the Rangers — on Dec. 27. “I learned the last couple of years if I don’t get to play every week — it might even be a week and a half or two weeks sometimes — you’ve got to just be ready to go and focused and take it game by game. It’s been nice to get a couple more minutes lately and get into more of a groove, but even if I don’t get that, I still have got to stay with it, and it’s been good so far.”

Capitals captain Alex Ovechkin remained at 598 career goals despite having an excellent chance for No. 599 late in the third period.

After Wilson cleared the puck and Tierney whiffed on an attempt to corral it, Ovechkin had a breakaway against Jones, who managed to stop Ovechkin — who had six shots on goal — and keep him off the scoresheet.