TAMPA, Fla. (AP) — Brandon Hagel had his second NHL hat trick, Steven Stamkos reached the 30-goal mark for the eighth time and the Tampa Bay Lightning rallied in the third period to beat the Montreal Canadiens 5-3 on Saturday night.

Stamkos tied it at 3 at 3:14 of the third with a power-play one-timer. Hagel put the Lightning ahead to stay at 5:58 with his second of the game when his deflection of Mikhail Sergachev’s shot went past Samuel Montembeault.

Hagel, playing his 200th NHL game, completed his hat trick by hitting the empty net with 43.6 seconds remaining.

Victor Hedman also scored for Tampa Bay, which was coming off back-to-back road wins against the New Jersey Devils. Brian Elliott finished with 18 saves.

Mike Hoffman, Denis Gurianov and Jesse Ylonen scored, Nick Suzuki had two assists, and Montembeault made 36 saves for the Canadiens. They were coming off a 9-5 road loss to the Florida Panthers on Thursday night in which they allowed seven goals in the first period.

The Canadiens opened the scoring 5:12 into the game when Hoffman took Suzuki’s pass from the right boards and snapped a shot from the slot past Elliott. The Lightning got even at 11:31 when Hedman’s wrister from between the circles beat Montembeault.

Tampa Bay went ahead 2-1 at 4:50 of the second period when Hagel took the rebound of Nikita Kucherov’s shot off the end boards and beat Montembeault from the right circle. But Montreal got even 1:29 later when Gurianov beat Elliott on a one-timer from the lower right circle, then went ahead 3-2 when Hoffman set up Ylonen’s power-play goal.

Canadiens forward Jonathan Drouin dressed for the game but did not see the ice after missing a team meeting Friday.