Portadown must now look to the Irish Cup final for a path into Europe following a day of derby drama.
Ten-man Glenavon sealed a 3-2 victory to grab a top-three finish and spot in the Europa League thanks to Andy McGrory’s last-minute penalty kick after Portadown had battled back from 2-0 down to level in the second half.
The in-form Lurgan side dominated the early exchanges and took the lead on six minutes when Kevin Braniff, the former Ports player, whipped across a corner-kick from the left that created problems inside the away area.
David Miskelly failed to gain any purchase on his attempt to swipe away the threat and the ball deflected off a group of players before a scrambled finish, with what looked like a decisive touch by Rhys Marshall.
Portadown produced a positive response as Peter McMahon attacked along the right and cut inside but the shot drifted the wrong side of the post.
Chris Casement - playing in his final appearance before starting a controversial six-game suspension - delivered a free-kick from the right which Michael Gault attacked but Kris Lindsay stepped in to hack away from a few yards off the line.
Sean Mackle, so often a threat against his hometown club, forced James McGrath into a fine save by finding space on the left-hand side of the box to collect and fire goalwards off Gary Twigg’s pass.
A looping Ross Redman free-kick was met at the back post by Ken Oman but Glenavon cleared the danger.
Lindsay came close to making an attacking impact but his near-post header off Mark Patton’s corner-kick cleared the crossbar.
Miskelly endured another nightmare moment on the half-hour mark when Glenavon pressure forced Portadown into a backpass and the goalkeeper’s miskick handed Eoin Bradley a clear run to finish into the gaping goal with a backheel.
Portadown entered the second half in determined form and enjoyed the majority of possession as Glenavon opted to hit the visitors on the counter-attack.
McGrath dropped low around 60 minutes to gather Twigg’s header after the striker rose well under pressure to meet Redman’s floating cross.
Glenavon picked up a red card on 70 minutes when James Singleton was dismissed - following consultation between referee Raymond Crangle and an assistant - for his angry reaction to a clearance by Oman. Oman and Michael Gault both picked up bookings in the aftermath.
Sustained Portadown pressure - including a string of corner-kicks from either side by Casement and Redman - placed 10-man Glenavon on the backfoot.
This led to a goal on 80 minutes when a loose ball dropped inside the box and McMahon’s half-volley found the back of the net.
Miskelly then stopped a Ciaran Martyn shot with his legs after strong play by Bradley.
Portadown completed the comeback on 82 minutes when another Casement corner-kick was met by Twigg and the header dropped over the line despite McGrath’s attempts to clear.
However, a final twist arrived with that last-minute penalty.
GLENAVON: James McGrath, Simon Kelly, Kris Lindsay, Andy Kilmartin, Eoin Bradley, Mark Patton, Andy McGrory, Rhys Marshall, Kevin Braniff, Ciaran Martyn, James Singleton. Subs: Gareth McKeown, Kyle Neill (on for Patton, 76 mins), Gary Hamilton (on for Braniff, 84 mins), Declan O’Brien, David Elebert (on for Hamilton, 92 mins).
PORTADOWN: David Miskelly, Chris Casement, Ross Redman, Keith O’Hara, Peter McMahon, Sean Mackle, Mark McAllister, Kenneth Oman, Michael Gault, Gary Twigg, Robert Garrett. Subs: Billy Brennan, Darren Murray (on for McAllister, 56 mins), Shea Conaty, Jordan Lyttle, Chris Ramsey.
Referee: Raymond Crangle.