Last updated on .From the section Scottish Premiership

Kris Doolan clipped home the vital winning goal for Partick Thistle - his 114th for the club

Partick Thistle beat Dundee to avoid automatic relegation from the Scottish Premiership and set up a two-legged play-off final duel with Livingston.

Replacement Kris Doolan stabbed home the game's only goal in the 63rd minute, ensuring Thistle finished 11th.

The Jags end the league season four points clear of bottom side Ross County, who drop to the Championship.

Thistle travel to Livingston on Thursday, 17 May, before hosting David Hopkin's men three days later.

The victor will play Premiership football next season.

The stunning Tayside sunshine provided the perfect paradox to the relegation cloud that was hanging over the heads of the visitors. Thistle, two points ahead of the Staggies, knew victory would preserve their top-flight status, but a draw, or defeat, would give County the chance to send them down.

Partick Thistle emerged from a hard-fought encounter with three precious points

The Dingwall side heaped pressure on their Firhill foes by taking an early lead against St Johnstone, and Alan Archibald's men started in a manner befitting a team scrapping for their lives.

They pushed and probed in numbers as Dundee, with pride only at stake, continually found themselves pinned back in their own half.

After Simon Murray flashed a fairly harmless effort across the face of Tomas Cerny's goal, at the other end Adam Barton's looping header was tipped over the bar by 19-year-old Calum Ferrie, making his first Dees start.

The hosts fought their way back into the contest and Paul McGowan had a fierce close-range effort parried away by Cerny - although the influential captain hobbled off with a hamstring injury shortly afterwards.

Just before the break the Jags should have taken the lead they craved so desperately, but Barton inexplicably hesitated from six yards, failing to show the necessary conviction to meet a fine Christie Elliot cross. Conor Sammon kept the play alive, but when the ball fell to him, Miles Storey lashed wide.

It was pretty stodgy fare after the break, neither side seizing control until just after the hour mark. Replacement Doolan, so often Thistle's go-to man, delivered the precious filip.

Stevie Lawless picked up possession inside the Dundee half, drove to the edge of the box, and when his through-ball ricocheted into the path of Doolan, the 31-year-old striker clipped the ball past Ferrie into the bottom-right corner of the net.

It was Doolan's 114th Jags goal - few will have been so important - and his 10th of the season, as he became the first Thistle player to hit double figures in eight consecutive campaigns.

Kris Doolan has scored 114 goals for Partick Thistle

When the celebrations subsided the visitors looked as though they couldn't quite decide between defending their lead or pushing for another that would surely kill the contest.

In their confusion Murray almost capitalised on poor defending to level, but his strike from 12 yards was blocked late when it looked goal-bound.

Wolters then lashed a left-foot drive on-target but Cerny saved low at his near post as the Thistle fans continued to chew on frayed fingernails behind the goal.

Neil McCann's men continued to throw everything at it but in the final throes, news of a St Johnstone equaliser in Perth reached Dens Park - blessed relief for the Jags.

Their supporters were jubilant, but they have two meetings with Hopkin's dogged and effective Livingston to negotiate before their Premiership status is secured.