Dundee await the winner of Raith Rovers and Dunfermline after grabbing the Championship’s second spot on the final day.
The Dark Blues left it late to move into the runners-up slot for the first time in the season as they leapfrogged Rovers with a 2-0 victory at Queen of the South.
A first-half brace from Jason Cummings was enough for James McPake’s side in Dumfries as Hearts won in Kirkcaldy.
Dundee made one change from the 2-1 victory over Raith last week. Defender Liam Fontaine limped out of that one with a hamstring problem and wasn’t risked at Palmerston.
That saw a return for Max Anderson in midfield with Jordan McGhee dropping back into the backline.
It was an emotional night for the home team as Stephen Dobbie made his final appearance for the club.
Fans gathered outside the stadium to welcome the club legend to Palmerston before the match while players and staff gave the striker a guard of honour onto the pitch.
The 38-year-old was one of four changes for the Doonhamers with their season over.
Chances aplenty in opening half
The visitors were after victory to have any chance of overhauling Raith in second and there was a keen ear out for news from Kirkcaldy.
However, it was Queens who were inches away from a lead inside two minutes.
The Dark Blues backline were wary of the pace of winger Isaiah Jones and allowed him to get to the byline. He cut back for Ayo Obileye who side-footed an effort off the post.
Five minutes in and Dundee had their first shot on target, Jason Cummings trying his luck but trundling the ball straight to Jack Leighfield.
Corners have been a real route to goal for James McPake’s men and they almost had joy once more from a Paul McGowan delivery.
Lee Ashcroft attacked it at the far post and it fell for McGhee six yards out but he couldn’t control the shot which flew well over.
With 12 minutes on the clock, news arrived of an opening goal for champions Hearts at Raith.
Less than two minutes later, Dundee almost got the goal they were after themselves as Paul McMullan drove into the area and rattled a fierce shot off the bar.
They did have the vital first goal on 16 minutes, however, as Cummings beat the offside trap and buried beyond the goalkeeper.
Dundee were in control but the home side were always a danger through Jones down the right.
And the Middlesbrough loanee was away on 24 minutes as Cammy Kerr failed to cut out a throughball. However, he dallied and tried to set up Dobbie, only for Ashcroft to block the shot.
On 33 minutes, it should have been 2-0.
McGowan played Anderson clear through on goal but the youngster fluffed his finish, steering the ball low past the far post.
However, that was quickly forgotten as Dundee stole the ball seconds later from the short goal kick.
McGowan laid it to Cummings in the centre whose initial shot was saved before the ball rebounded into the net.
The scoreline may have been more comfortable but the Dundee defence were anything but as the home side pushed to get back into the contest.
Cummings, though, was switched on as he cleared a Rhys Breen header off the line on 41 minutes.
Manager McPake was clearly unhappy with some of his players’ defensive work as they allowed the home side into dangerous positions.
Queens were causing their own problems as well as McMullan nicked the ball in midfield and eventually cut into the area but stuck his shot wide of the post.
Lead to protect with one ear on Kirkcaldy
There was still plenty of work to do in the second period at Palmerston for Dundee.
The home side gave a warning early in the period as the ball dropped to Aidan Fitzpatrick on the edge of the area.
The wideman hit his volley into the plastic turf, however, and Adam Legzdins gathered with ease.
Up the other end, Cummings was after his hat-trick. Charlie Adam played him in but the striker screwed his left foot effort wide from an angle.
Before the hour mark, Hearts were winning 2-0 themselves and Dundee were sitting in the second place they were after.
As the second half wore on, Dobbie was still searching for his goal. He tried his luck from 20 yards but curled straight into the arms of Legzdins.
It was game over at Stark’s Park as the Jambos netted a third and fourth against 10-man Rovers.
Dundee were popping the ball about knowing they only had to see the game out.
And they did just that, despite a few nervy set-pieces to defend. With that they secured the runners-up spot to give themselves a breather ahead of their play-off semi-final.
Their first leg against either Raith or Dunfermline will take place on Wednesday, May 12.
Queens: Leighfield, Maxwell, Buchanan, Obileye, Fitzpatrick, Goss (Shields 59), Dobbie (Joseph 72), McCabe, Breen (Nortey 46), Jones, Gibson.
Subs not used: Ferguson, Pybus, East, McMahon.
Dundee: Legzdins, Elliott, Ashcroft, McGhee, Kerr, Byrne, Anderson, Adam, McGowan, McMullan (McDaid 73), Cummings (Sow 78).
Subs not used: Ferrie, Jakubiak, Mullen, Afolabi, Fisher.
Referee: Don Robertson.