Partick Thistle needed a penalty save from Scott Fox before knocking Cowdenbeath out of the League Cup in a breathless period of extra-time.
Fox pushed away a spot-kick from Jamie Stevenson as the visitors wasted the best chance of a goalless 90 minutes.
Jags substitutes Christie Elliot and Steven Lawless netted either side of a great solo effort from Kane Hemmings as play raged from end to end.
And skipper Aaron Muirhead settled the issue from the penalty spot.
Thistle had survived a couple of early scares before the first half settled into a rhythm of the hosts knocking the ball about inside the opposition half but rarely getting in behind or round the outside of a packed Cowdenbeath defence.
Striker John Baird was often lacking in support and he had Thistle's best first-half effort when he met Stephen O'Donnell's cross first time from 12 yards which Grant Adam got down well to hold.
Baird had a better chance two minutes after the break when James Craigen's flick put him through but Adam again blocked his powerful strike.
Cowdenbeath left-back Kenny Adamson gave his side the perfect chance to take the lead in the 55th minute when he shimmied past one man before wrong footing Muirhead, who stuck out a foot and tripped him up inside the box.
Jamie Stevenson slowed down his run-up but Fox dived low to his right to push the midfielder's spot-kick wide.
Lawless and Kris Doolan came on but Thistle still struggled to create clear chances before putting more pressure on as the 90 minutes progressed.
Baird went down in the box under pressure from Nathaniel Wedderburn in injury-time but referee John McKendrick booked him for diving and there was still time for Adam to block Doolan's shot.
Another substitute, Elliott, finally broke the deadlock two minutes into extra-time when he angled a shot inside the far post after being set up by fellow sub Lawless inside the box.
But Cowdenbeath went straight up the park and levelled when Hemmings burst into the box following a powerful run and shot low into the corner.
The former Rangers forward then saw a shot brilliantly saved by Fox after a one-two with Jordan Morton and John Armstrong headed wide from the resulting corner.
Gabriel Piccolo blazed over following a corner at the other end but Thistle found the net in the 103rd minute when Doolan's lay-off fell to Lawless and the former Motherwell man fired low into the bottom corner.
Fox saved a powerful Hemmings strike and Thistle wrapped up the win with four minutes left when Muirhead sent Adam the wrong way after Morton had brought down Lawless just inside the box.
- 01 Fox
- 02 O'Donnell
- 03 Sinclair
- 05 Muirhead
- 13 De la Vega
- 07 Craigen (Lawless - 62' )
- 08 Bannigan
- 10 Forbes
- 20 Kerr (Doolan - 71' )
- 23 Higginbotham (Elliot - 84' )
- 17 Baird Booked
- 12 Gallacher
- 11 Lawless
- 19 Osbourne
- 09 Doolan
- 14 Elliot
- 17 Adam
- 03 Adamson
- 05 Armstrong
- 06 Wedderburn
- 14 Brett
- 04 O'Brien
- 07 McKenzie (Morton - 78' )
- 08 Stevenson
- 18 Milne
- 09 Stewart (Miller - 95' )
- 10 Andrew Russle (Hemmings - 72' )
- 01 Flynn
- 02 Cowan
- 11 Morton
- 20 Miller
- 21 Hemmings