Partick survived a huge scare before scraping into the third round of the Scottish League Cup with a battling 3-1 victory over Cowdenbeath at Firhill.
Thistle struggled to convert possession into goals and were taken to extra-time before goals from Christie Elliott, Steven Lawless and Aaron Muirhead saw them through.
Partick hit their stride early on as Kallum Higginbotham fired over after a mazy run, while John Baird drilled straight at Grant Adam and sent another effort wide after good work from Stephen O'Donnell.
Adam dealt with a decent long-range effort from Ross Forbes, and the visiting goalkeeper then got his angles right to beat away another Baird strike.
Cowdenbeath survived until the break before being gifted a golden chance to snatch the lead on 54 minutes when Kenneth Adamson was hauled down in the box by Muirhead and referee John McKendrick pointed to the spot.
But Scott Fox guessed right to save James Stevenson's penalty, and Baird was again denied by Adam from close range as Thistle resumed their dominance.
A Forbes free-kick drifted narrowly wide, and Lawless had a goalbound shot scrambled off the line with six minutes remaining.
Adam ensured extra-time with a smart save from Kris Doolan, but Partick finally broke the deadlock on 92 minutes when Elliott latched onto a Lawless feed and beat Adam from a tight angle.
However, Cowdenbeath levelled just a minute later as Kane Hemmings found space to slot past Fox, who did then well to deny the former Partick triallist a second with a brilliant reaction save.
But having ridden the storm, the hosts regained the lead in the 103rd minute when Elliott teed up Lawless, who swept a composed finish beyond the reach of Adam.
And with seven minutes remaining, Lawless was brought down by Jordan Morton in the area and Muirhead made no mistake with the resulting penalty.