LEWISTON, Maine — Waterville’s stars came to play.

Jackson Aldrich and Justin Wentworth each had a hat trick to lead the Purple Panthers to a 7-4 high school hockey victory over York to capture the Class B state championship on Saturday at the Androscoggin Bank Colisee.

The win gives the Purple Panthers their second straight Class B title after years of being a dominant force in Class A. They now have 22 state championship trophies to their name.

Wentworth finished the year with 47 goals and Aldrich capped off his campaign with 34.

The game concluded with a wild seven minutes. Jake Martin tied the game at 4-4 for York when he ripped a shot over stunned Waterville goalkeeper Nathan Pinette from below the goal line. His shot hit the inside of the far post and clanged in with 6:48 remaining.

Aldrich scored his second of the game seconds after Wentworth hit the post to make it 5-4 with 3:34 remaining in the game.

Wentworth capped his hat trick on a breakaway less than two minutes later. He made York goalie Keenan Gamache commit, dragged the puck to his backhand and shoveled it into the cage for an easy insurance marker.

Down by two, York pulled Gamache with a power play, but it was too little, too late. Shorthanded Waterville send the puck down the ice and Aldrich put the puck into the empty cage with three-tenths of a second left.

“They seemed like they were in the mood today,” Waterville coach Dennis Martin said. “They came back to the bench and they said, ‘Coach, we have plenty of gas left in us.’ Jackson and Justin they kept coming and saying, ‘I’m ready,’ every 50 seconds. It was their last game they could play, they brought everything to the table. That’s what they’ve always done.”

Waterville (20-1-0) had the shot advantage in the first period, 13-6, and was the first to get on the board. Matt Jolicoeur found Aldrich just inside the slot. His shot hit inside the post and deflected into the cage and out the other side. The goal came at the 6:24 mark.

York didn’t wait long to respond. Jake Martin found a streaking Julius Lundgren and he buried the puck 17 seconds later.

Gamache made a couple big saves for York (17-3-1) to keep the game tied at 1-1 after one period. He made 24 saves in the game. His counterpart, Pinette, made 17 saves for the Panthers.

Waterville looked to run away with the game early in the second. The Aldrich-Wentworth-Michael Bolduc line started, and within 33 seconds, the score was 3-1, with Bolduc and Wentworth scoring the goals. All three players factored into both goals.

“It was a hustle play and we won the puck and Jackson picked up the loose puck,” Martin said. “Michael was wide open in the front and slid it through him. We finish that shot and we go down and do the same thing, we beat the guy in the front. They left him wide open.”

Wentworth made it 4-1 with 2:36 remaining in the period with an unassisted marker.

“We knew we had to come up big,” Wentworth said. “More importantly, we knew we had to come together as a family to pull it off. Us seniors, it was our last game, no matter what.”

York wasn’t going down without a fight. Martin and Lundgren found Spencer Pickett 23 seconds after Wentworth’s second of the game. Martin then found Andrew Bertolini at the top of the slot and Bertolini hammered home another with 26 seconds left in the period.

“The one thing I will remember from this game, the easiest way to say it, is how easy it would have been for a lesser team to pack it in at 4-1, to be honest with you,” York coach Jim Powers said. “The other night against Greely, and we had all these penalties and everything, those guys fought so hard they could have been down 4-, 5-0 in that game. We played solid penalty kill and everything, but you get here today and you got this dream of winning a state championship and you are down 4-1. You are saying it’s slipping from us and they didn’t let it.”

Martin’s equalizer set up Waterville’s sprint to the finish.