Morton scored three goals in the last seven minutes to complete a remarkable comeback and beat 10-man Ayr 3-2 in the Scottish Championship.
Lewis Strapp was the hero as he scored in the 88th minute to cancel out an earlier own goal and follow up strikes from substitute Gary Oliver and Cameron Blues, with Cammy Smith scoring for United, who had Aaron Muirhead sent off.
Bruce Anderson had already hit the post for Ayr when they took the lead just after the half-hour, Strapp turning Smith's cross into his own net.
Muirhead was sent off after a tackle on Joshua McPake seven minutes into the second half but United still doubled their lead with 16 minutes to play as Smith found the net.
Oliver netted with seven minutes to go after a scramble and, two minutes later, Blues stopped an Ayr clearance and finished from close range.
Strapp then made up for his earlier error as he got his head onto Brian McLean's long ball to seal victory two minutes from time.