Kilmarnock will face Dundee in the play-off final despite a 2-0 win at Hamilton which officially relegated Accies from the Scottish Premiership.
A first-half double from Mitch Pinnock gave the visitors a last-day victory although he passed up on the chance of a hat-trick when debutant Hamilton goalkeeper Jamie Smith saved his second-half penalty.
Ross County needed just a point at Motherwell to ensure safety and emerged with 2-1 win.
Accies’ relegation was confirmed after the nine-goal win they needed to leapfrog the Rugby Park side unsurprisingly failed to materialise.
After seven years in the top flight, boss Brian Rice will reset in the summer and go again.
Kilmarnock, though, still have their future in their own hands and Tommy Wright’s team, who finished in 11th place, will travel to Dens Park on Thursday with the second leg at Rugby Park on the following Monday.
Accies’ fate was effectively sealed with the 2-1 defeat at Ross County on Wednesday night.
Rice made five changes, handing starts to Ben Stirling, Kyle Munro, Ronan Hughes, Lewis Smith and 19-year-old 'keeper Jamie Smith – one of seven academy players starting.
Kilmarnock changed their 'keeper too with Colin Doyle replacing Danny Rogers, while Brandon Haunstrup replaced left-back Calum Waters.
Amid an enthusiastic start by eager Hamilton, the Ayrshire side opened the scoring after nine minutes with their first real attempt on goal.
Defender Ross Millen swung a tantalising cross in from the right and Pinnock got in front of Stirling to knock the ball in from around six yards.
The home side were undeterred. The lively Lewis Smith was causing problems for Kilmarnock in attack and had one goal-bound shot blocked by Killie centre-back Zeno Ibsen Rossi.
The match, however, was being mostly played between the two penalty areas, although a powerful Pinnock shot from the edge of the box in the 39th minute was deflected behind by Hamilton defender Aaron Martin for a corner which was repelled.
Pinnock had more luck a minute before the break on a swift counter-attack when midfielder Alan Power sent him running clear and the former AFC Wimbledon midfielder slotted his shot low past Smith.
Hamilton pressed with added purpose at the start of the second half but still Doyle was not unduly troubled.
Pinnock, sensing a hat-trick, fired a long-range effort wide while a much better effort from inside the box minutes later was blocked by Hamilton substitute George Stanger.
Pinnock then had a gilt-edged chance from the spot after Martin brought down Kyle Lafferty having been caught in possession but Smith dived to his left to beat away the spot-kick.
Substitutes continued to pile on and Killie 'keeper Doyle tipped a curling shot from Nathan Thomas over the crossbar and fellow replacement David Moyo lofted a shot over the bar before Thomas did likewise.
But the visitors held out and now need to take a deep breath and prepare for the double-header against Dundee.
What the managers said
Hamilton manager Brian Rice: "I am devastated and I know the supporters will be as well. I take it on the chin, I carry the can, I understand that.
"It is disappointing for everybody connected to the club, every player, coach, owners, supporters. But we have to use that as a tool to remember to spur us on and that is what we will do.
"There is no time for looking back, or regrets or excuses, so we need to start looking forward. I will go away with the positives, seeing so many of the young players' performances today.
"I thought some of them were outstanding. I was proud of them. I'm just disappointed we lost the match."
Kilmarnock manager Tommy Wright: "I am pleased that we are going into the game in the run of form we are in. I think it is one defeat in nine or 10 games over 90 minutes and they look as if they are a real goal threat.
"I think it is also 26 goals over 10 games and it should have been more today so over two legs, we go in with confidence based on the performances I've had recently.
"I watched them [Dundee] last night and I watched them against Dunfermline earlier on in the season and we have scouting reports on them as well.
"It is one of those files on your computer that you didn't want to open but we will get into it tomorrow and prepare well.
"So we know the task ahead of us but I am sure they will be looking at us as well and thinking we are a decent side as well so it is all set up for big finale."