Lewis Hawke scored a late winner as Morton edged past Cowdenbeath to keep in touch with the league leaders Partick Thistle.
The visitors had kept out their high-flying opponents for 88 minutes before the substitute pounced.
Cowdenbeath - who are now without a win in nine league games - defended resolutely for the first period and could have gone ahead after half-time but Dean Brett's effort from the edge of the area was well held by Derek Gaston.
The home side looked the more likely to find the winner as the game neared its conclusion and Thomas Flynn had to save from Martin Hardie and Michael Tidser in the last 10 minutes.
However he could do nothing about the winner as David Graham's cross was headed into the back of his net by Hawke from close range.
Morton: Gaston, Taggart, Reid, Rutkiewicz, Dyer (Wilkie 72), Bachirou, Hardie, Tidser, Graham, Weatherson, O'Brien, Wilkie (Hawke 81).
Subs Not Used: Hutton, Mark McLaughlin, Halsman.
Goals: Hawke 88.
Cowdenbeath: Flynn, Cowan, O'Brien, Armstrong, Adamson, McKenzie, Puigdollers (Brett 38), Miller, Stevenson, Ramsay, Coult (Stewart 60), Stewart (Navas 70).
Subs Not Used: Wight, Garcia-Rey.
Ref: Craig Thomson