Dundalk had two players sent off, conceded two penalties and finished the match with just eight players as they self-destructed at Richmond Park to all but gift a sluggish St Patrick's Athletic three valuable points.
A generally lacklustre game exploded into life on 70 minutes.
Substitute Chris Lawless was sent off for deliberate handball off Martin Russell's goalbound shot, though it was referee Paul McKeon's assistant that saw the incident. James Keddy, already on a yellow card, was then also dismissed for dissent.
To add to the drama, Russell's penalty came back off John Connolly's left-hand post but Charles Mbabazi Livingstone was on hand to shoot home the rebound.
Dundalk's nightmare continued as they then had captain David Crawley carried off on a stretcher on 86 minutes.
Two minutes later Martin Murray's relegation-threatened side conceded a second penalty when Ciarβn Kavanagh tripped Ger McCarthy as he chased the St Patrick's striker into the area. Russell made no mistake from the spot, blasting his penalty straight down the middle.
Neither side endeared themselves to the sizeable crowd in a fitful first half, notable for Dundalk losing two players through injury.
St Patrick's pumped themselves up with loud, and justifiable, appeals for a penalty on 10 minutes when Kevin Doyle appeared to be tripped inside the area by former St Patrick's defender Stephen McGuinness. McKeon waved play on.
David Hoey then followed Liam Dunne off the field with a head injury as Dundalk had to regroup. But Dundalk more than held their own with Keddy and John Flanagan having decent shots. However, Pat Dolan's side upped the tempo after the interval.
Mbabazi shot wide after good work by Russell while McCarthy scooped over the bar after Connolly flapped at Russell's free kick, all inside seven minutes of the restart.
ST PATRICK'S ATH: S Kelly; Croly, Maguire, Colm Foley, Burke; Marney, Osam, Russell (Mannion 90); McCarthy, Mbabazi (Harris 89), K Doyle.
DUNDALK: Connolly; Hoey (Lawless 40), Broughan, McGuinness, Crawley; Kavanagh, Flanagan, Dunne (Prizeman 30), Keddy; Haylock, Nesovic (Reilly 73).
Referee: P McKeon (Dublin).