Goals from Kyle McAllister and Kyle Magennis ensured St Mirren's fight for automatic safety will go to the last day of the Ladbrokes Premiership season after a dramatic 2-0 win over fellow relegation battlers Hamilton.
In the 29th minute of a frenetic encounter, Accies centre back Alex Gogic was given a straight red card by referee Willie Collum for hauling back Saints striker Simeon Jackson, who threatened to race clear on goal.
Oran Kearney's side then dominated possession and earned their reward with strikes in the 74th minute from McAllister and deep in added time from Magennis.
The win has lifted the second-bottom Buddies to within one point of Hamilton, and with a better goal difference.
Saints travel to already-relegated Dundee in their final fixture, with Hamilton hosting St Johnstone to determine who will finish 11th in and in the relegation play-off spot.
Accies missed the first chance after four minutes when keeper Gary Woods launched a long ball which fell kindly to striker George Oakley, who rounded Buddies keeper Vaclav Hladky, only to fire over from 14 yards.
The poor finish was replicated a minute later at the other end when Magennis, back for the injured Ryan Flynn, was equally off-target with his finish.
Collum was letting plenty go until the 19th minute when he booked Hamilton right-back Aaron McGowan for a kick at Saints attacker Danny Mullen, with home captain Stephen McGinn also cautioned for vociferously complaining.
McAllister then went close for the home side with a low drive before Gogic saw red for preventing Jackson getting past him 35 yards from goal as he was deemed to be denying a clear goal scoring opportunity.
Boss Brian Rice immediately brought on centre-back Lennard Sowah for teenage midfielder Reegan Mimnaugh.
The home fans then screamed at Collum to take further action taken when Accies striker Marios Ogkmpoe flattened St Mirren defender Gary MacKenzie who, suffering from a head knock, had to be replaced by Jack Baird.
The intense battle continued after the break, with Saints piling on the pressure.
In the 53rd minute defender Mateo Muzek's cross from the left was headed over by Mullen before McAllister drove an effort over.
In a rare Hamilton attack, substitute Mickel Miller, on for Ogkmpoe, screwed his shot wide of the target.
St Mirren returned to bombarding Accies' penalty area and Woods brilliantly
tipped a header from Mihai Popescu over the bar with the Lanarkshire side escaping from another corner.
The home side were unrelenting, however, and eventually made the breakthrough when McAllister composed himself to drive low into the corner after Sowah had blocked his initial effort.
Woods then saved another goal-bound drive from McAllister as Saints attempted to finish off the job.
When Miller was forced off injured in the final minute of normal time after a tangle with Baird, Accies went into the final six minutes of added time with only nine men as they had used all three substitutes.
With seconds remaining, Magennis took advantage of a defensive lapse to drill in his side's second and force the fight to avoid the drop to the final day.
ga('create', 'UA-72310761-1', 'auto', {'name': 'pacontentapi'});
ga('pacontentapi.set', 'referrer', location.origin);
ga('pacontentapi.set', 'dimension1', 'By Ronnie Esplin, Press Association Sport');
ga('pacontentapi.set', 'dimension2', 'c7d3f712-f77c-42e8-90d0-836b0bca0fde');
ga('pacontentapi.set', 'dimension3', 'paservice:sport,paservice:sport:club-news,paservice:sport:football,paservice:sport:match-reports');
ga('pacontentapi.set', 'dimension6', 'story');
ga('pacontentapi.set', 'dimension7', 'composite');
ga('pacontentapi.set', 'dimension8', null);
ga('pacontentapi.set', 'dimension9', 'sport:football');
ga('pacontentapi.send', 'pageview', { 'location': location.href, 'page': (location.pathname + location.search + location.hash), 'title': 'Kyle-right on the night for St Mirren as they take relegation fight to last day'});