Motherwell must face a playoff against Championship opposition to retain their Scottish Premiership place after they were beaten by already-relegated St Mirren at Love Street.
John Sutton's 75th-minute penalty gave the Lanarkshire club hope of surviving, but a late Jason Naismith equaliser and a stoppage-time Stevie Mallan stunner means that Motherwell are in danger of dropping into the second tier.
Scott McDonald almost gave Well, who needed a win to stand any chance of avoiding a playoff, the perfect start when he forced a save out of Marian Kello in a cagey opening period.
Their faint hopes of survival were given a boost when they were awarded a penalty after Thomas Reilly fouled Lee Erwin in the box, which substitute Sutton converted.
However, they were pegged back when Naismith's shot from a tight angle found a way through George Long.
With results elsewhere having gone against them, Motherwell's afternoon worsened when McDonald was given a straight red card for a poor challenge on Reilly.
With both Ross County and Kilmarnock already assured of staying in the top flight, Motherwell then conceded a second in the seventh minute of injury time as Mallan's rocket of a strike from 25 yards found the top corner of the net.