The Somerset Park side went ahead on 53 minutes when skipper Jon Paul McGovern curled a sublime free-kick over the wall and into the net via the underside of the crossbar.

Ton struggled to put much together in the way of threatening attacking football in the second half and even had goalkeeper Derek Gaston to thank for keeping them in the game with a crucial stop.

When news filtered through that table toppers Stranraer had taken the lead against Airdrie with just seven minutes remaining, it seemed certain to be a disastrous afternoon for Jim Duffy’s men.

However, they then staged a miraculous, Houdini-like escape in the closing stages to put their title challenge back on track.

With just one second of normal time remaining, Declan McManus nodded into the net to level things up after Ricki Lamie had directed a Ross Forbes free-kick towards goal.

Then, in the second minute of stoppage time, playmaker Forbes curled a low shot beyond David Hutton to spark bedlam across Cappielow as Ton snatched victory from the jaws of defeat.

Morton (4-4-2): Gaston; Kilday, O’Ware, Lamie, Russell; J. McCluskey, Miller, Forbes, McManus; MacDonald ©, Caldwell.

Subs not used: Crighton, Ferris, Adam (gk).

Booked: McCluskey (90+2).

Ayr United (5-3-2): Hutton; Murray, Devlin, Murphy, McKenna, Donald; Gilmour, McGovern ©, Crawford; Preston (Nisbet, 90), Robertson Subs not used: Neill, Muir, Campbell, Newman (gk).

Booked: Murray (77), McKenna (89).

Attendance: 1,552 Referee: George Salmond