HERSHEY, Pa. - With an 11-point advantage and less than nine minutes to play Thursday night, Imhotep Charter seemed well on its way to capturing a second consecutive state championship.

But Erie Cathedral Prep pulled off a remarkable fourth-quarter rally, scoring 18 unanswered points in just four minutes, and claimed the PIAA Class 4A crown with a 27-20 victory at frigid HersheyPark Stadium.

In avenging last year's 40-3 pounding at the hands of the Panthers, District 10's Cathedral Prep (14-0) won its first state title since 2012 and third overall.

The Ramblers' late scoring surge was made up of Anthony Lupo's 35-yard field goal, Terry Roberts' 36-yard interception return, and Joe Mischler's 63-yard pass to wideout Tyler Oedekoven.

Early in the second half, on third and 10, Nasir Boykin connected over the middle with Aamir Brown for a 31-yard TD to give Imhotep a 20-9 cushion. Brown neatly split a pair of defenders on the play.

But Mark Schmidt's squad sputtered on offense from there. And, with the game deadlocked at 20, Oedekoven's long touchdown reception with 4:56 to go was the clincher.

On its second series of the night, Imhotep grabbed an 8-0 lead on Boykin's 8-yard fade toss to Justin Harris in the left corner of the end zone and Isheem Young's conversion run.

Cathedral Prep immediately answered back to make it 8-7. A roughing-the-passer penalty and Mischler's 19-yard pass over the middle to wideout Henry Fessler set up Matt Lupo's 1-yard TD dive.

With five minutes remaining in the first half, junior linebacker and Notre Dame recruit Matt Bauer sacked Boykin in the end zone for a safety that gave the Ramblers a 9-8 edge.

The Panthers (13-1) went back in front, 19-14, just before the break when, on fourth and inches from their own 46, Young zipped through the middle and raced untouched for a 54-yard tally.

Imhotep, which was making its third appearance in a state final, was penalized eight times for 91 yards in the windy first 24 minutes.

The Panthers also failed to cash in on a golden scoring opportunity in the second frame.

After Jeffrey Davis' 64-yard punt return put the District 12 champs at the Cathedral Prep 16, they came away empty. Boykin's fourth-down pass attempt from the 12 was disrupted by a strong rush from linebacker Jerry Roberts.

Young, a junior who doubles as a free safety and has 20-plus scholarship offers, carried 13 times for 85 yards. Boykin gained 41 yards on 18 attempts.

Imhotep Charter 8 6 6 0 - 20

Erie Cathedral Prep 7 2 0 18 - 27

IC: Justin Harris 14 pass from Nasir Boykin (Isheem Young run)

ECP: Matt Lupo 1 run (Anthony Lupo kick)

ECP: Safety

IC: Isheem Young 54 run (run failed)

IC: Aamir Brown 31 pass from Boykin (pass failed)

ECP: FG Anthony Lupo 35

ECP: Terry Roberts 36 interception return (Joe Mischler run)

ECP: Tyler Oedekoven 63 pass from Mischler (Anthony Lupo kick)