Dundee are back in the Scottish Premiership after a nervy 2-1 win over Dumbarton on the final day of the Championship season.
Goals from Christian Nade and Peter MacDonald put the Dark Blues 2-0 up and in cruise control, but a Scott Agnew penalty combined with an amazing performance from Hamilton meant tension was the order of the day at Dens Park.
A capacity crowd celebrated when Nade headed home a Kevin McBride free-kick in the 25th minute to give Dundee the lead - they went into the game knowing a victory would be enough for Paul Hartley's men to secure the title.
MacDonald doubled the lead 11 minutes later with another header, this time from Gary Irvine's cross.
But Dumbarton ensured there would be plenty of tension during the last 20 minutes when Willie Dyer brought down Bryan Prunty and Agnew scored from the penalty spot.
Those nerves would only have increased if Dundee fans were following what was happening at Hamilton, who ended up putting 10 goals past Morton and winning 10-2.
As it transpired, another Dumbarton goal would have handed the Accies promotion on goals scored.
Mickael Antoine-Curier scored four goals for Hamilton and Anthony Andreu weighed in with a hat-trick, their other goals coming from Louis Longridge, Michael Devlin and a Stuart Findlay own goal, but they have to settle for a playoff spot.