
Jordan Davies (second right) scored his second goal of the season
A stunning victory for Greenock Morton rocked Ayr United's Scottish Championship title hopes and took Dougie Imrie's team to within four points of the play-off places.
Curtis Main's strike gave Ayr a seventh-minute lead, which they held until half-time.
Cammy Blues scored an equaliser form close range after the break before substitute Jordan Davies forced a dramatic winner at a corner.
Morton even survived a late red card for Dylan Corr, dismissed for a reckless challenge on Jake Hastie.
Scott Brown's Ayr trail leaders Falkirk by six points.
What they said
Greenock Morton manager Dougie Imrie: "There was nothing between the teams in the first half. But I was proud of our second-half performance."
Ayr United manager Scott Brown: "We can't keep giving away easy goals. I'm not going to focus on the run-in. We are looking no further than the next game."