BIDDEFORD — Brenden Whitten had three goals and an assist to lead the Kennebunk boys’ hockey team past Greely 5-1 in a Class B South game Monday at the University of New England.

Whitten scored in all three periods to help the Rams improve to 7-1. The senior forward’s timely goals proved crucial in beating the Rangers (3-3), who, despite the lopsided score, finished with a 26-18 edge in shots on goal.

“He stepped up big tonight, and we needed it,” Kennebunk Coach Sean Smith said of Whitten. “He definitely played a big role in getting the win.”

Whitten scored the Rams with 9:42 left in the first period. Jakub Simikak brought the puck into Greely’s defensive zone before crossing it to Whitten, who scored on Kennebunk’s first shot on goal.

Greely’s Matt Kramlich answered with 3:10 left in the period when he scored from Jake MacDonald. The Rangers held a 9-4 edge in shots after the first period.

“I thought we had a lot of momentum coming out of that period,” Greely Coach Barry Mothes said. “Unfortunately, we weren’t intense enough in the first five or six minutes of the second period. That really hurt us.”

Kennebunk came alive in the second period. Whitten scored his second goal with 12:10 left on an assist by Christian Putnam. Two minutes later, Whitten picked up an assist when Simikak put away a rebound of a Whitten shot to give the Rams a 3-1 lead.

“After the first period, we knew we didn’t really play our best,” Whitten said. “We had more in us. We just came out harder and right away just started battling. I think we took a good momentum swing after that first goal, which allowed us to get that second one.”

The Rangers, however, looked poised to close the gap. They opened the third period firing nine shots on goal while allowing the Rams just one.

However, Kennebunk goalkeeper Spencer Desrochers and his defense thwarted Greely’s efforts to climb back into the game.

“Miles Eaton and Walker Robinson had incredible games on defense,” Smith said. “Without them and the way they anchored the defense tonight, we wouldn’t have gotten this win either.”

Kennebunk added two empty-net goals in the final minutes. Whitten scored his third on another Putnam assist (1:07), and Zachary Brown scored from Kyle Beaupre with 48.1 seconds left.

Desrochers finished with 25 saves, and Greely’s Karsten Bourgoine had 13.

“Our goalie, Spencer Desrochers, has saved us in the last two games,” Whitten said. “It just really helps us win when we have that security net behind us. Even if we do get beat, he has our back.”

Kennebunk has won its past five games and totaled 43 goals this season. The Rams’ only loss was 4-0 on Dec. 20 to Class A Thornton Academy.

Before Monday, Greely’s only two losses this season had been to last season’s Class A and B Southern Maine runners-up: Falmouth and Gardiner. Greely will play Saturday at Cape Elizabeth, and Kennebunk plays host Gardiner on Monday.

“We were coming down here to win today,” Mothes said. “We made it really hard for us to get back in the game. It’s a competitive league, and this wasn’t good enough.”