It took the entire first period for the Sharks, playing in the second of a back-to-back, to get their legs moving against a dreadful Edmonton Oilers team.

Fortunately for them, the power play was running on all cylinders, a rarity for the club since the calendar flipped to 2014. Joe Pavelski recorded his third hat trick this season, and the power play struck for three goals in a 5-2 win over the Edmonton Oilers at Rexall Place on Tuesday.

San Jose, whose power play percentage had fallen to 23rd in the NHL headed into Tuesday’s game, scored multiple power play goals for the first time since Dec. 31, 33 games ago.

The Sharks moved four points ahead of Anaheim for first place in the Pacific Division, although the Ducks have three games in hand.

San Jose trailed 1-0 on David Perron’s first period goal, but a pair of power play goals turned that into a 2-1 lead in the second period.

Pavelski ended a seven-game goal drought to tie it, pouncing on a Patrick Marleau rebound at 6:28 with Ryan Smyth off for holding.

Another holding penalty, this one to Andrew Ference, put the Sharks back on a man advantage two minutes later. A long shift by the top unit eventually resulted in a shot attempt by Brent Burns, who took the place of an injured Logan Couture. The shot was blocked, but Pavelski managed to get the loose puck to an open Marleau, who released a laser past Ben Scrivens at 9:57.

A late goal by Marty Havlat gave San Jose a three-goal cushion at the break. On a two-on-one with Tommy Wingels, Havlat jammed a quick, low wrist shot inside the near post with half a minute remaining in the middle frame.

Havlat, who was scratched from the lineup for two games after the trade deadline, has five goals in his last 10 games.