A goal by Partick Thistle substitute Paul McGrillen three minutes from time gave them all three points in a 2-1 win after they had allowed Queen of the South back into the game.
It had been all one-way traffic in the first half, but for all their pressure Partick could only score one goal after Scott McLean had headed home a Danny Lennon corner on 26 minutes.
Partick then seemed to ease up and Queens took advantage with Paddy Atkinson pulling them level in 72 minutes.
And just when a draw looked certain, McGrillen nipped in to sweep home another corner from Lennon.