LEWISTON — Phil Tarling scored two goals 10 seconds apart late in the third period Friday night to lift second-seeded Cape Elizabeth to a 4-2 victory against third-ranked York in a Class B South boys’ hockey semifinal at the Androscoggin Bank Colisee.

The Capers (15-2-2) will play No. 1 Greely for the regional title Wednesday night at the Colisee.

Tarling snapped a 2-2 tie with a little more than five minutes left when he put in a shot from the right circle after Ryan Collins drew the puck to him on a faceoff. Moments later, Tarling skated down the left side and scored again after Collins won the center-ice faceoff.

“We got some bounces off faceoffs and we were able to score some big goals,” Cape Elizabeth Coach Matt Buotte said. “It’s nice when the puck bounces your way.”

Collins, who had three assists, also won a faceoff in the second period to set up the first of two goals by Alex Glidden.

The victory came five weeks after the Capers beat the Wildcats 8-1 in Portland.

“In that game during the regular season, that was our night,” Buotte said. “It was one of those games where the score didn’t reflect the slight disparity between the teams.

“We knew (York) was a really quality team. We knew we had a dogfight. We knew it wasn’t going to be easy. It was not going to be a cakewalk.”

The Wildcats (14-6) opened the scoring 10 minutes into the second period when Jacob Martin put a backhander just inside the far post after Peter Haber kept Jacob Nelson’s shot out of the right side of the goal. Martin, who was backing up to the end boards, got his stick on the rebound and sent the puck across the crease.

Less than three minutes later, Glidden tied it when he put in a shot from the right circle following a faceoff.

A little more than two minutes into the third period, York took a 2-1 lead when Spencer Pickett finished off a two-on-one break by directing Mark Engholm’s pass across the slot into the left side of the goal.

Less than a minute later, Glidden tied it by lifting in a shot from just outside the crease.

“We competed very well,” York Coach Jim Powers said. “Unfortunately we had a couple of turnovers and a couple of plays off faceoffs that cost us dearly in the end.”

Both goalkeepers had big moments in a scoreless first period.

Five minutes in, Haber, who made 14 of his 28 saves in the first period, dropped to his knees to make a pad save when Engholm got in behind the defense and shot from the slot.

“To be honest, we’ve come up here and lost games in the first period because the team’s shaky and the goaltender’s shaky,” Buotte said. “The first five minutes we were a bit shaky and (Haber) allowed us to settle down in the game. He was amazing.”

With about five minutes left in the period, York goalie Keenan Gamache stopped two breakaways by Gus Frankwicz. With 2:50 left, Haber tracked the puck when Pickett tried to tip in Andrew Bertolini’s shot from the right circle during a two-on-one break.

“Gamache is one of the best in the league and he’s tough to beat,” Buotte said. “It took a lot of chipping away before we were able to break through.”