Michael Moffat scored all four goals as Ayr kept their play-off hopes alive with a 4-1 win against 10-man Arbroath at Gayfield.
Mark Roberts' side fell behind in the second minute when Derek Holmes tucked away Ross Chisholm's left-wing cross.
The Honest Men had to wait until the 41st minute to draw level when Moffat scored from the penalty spot after Alexander Keddie brought down Neil McGregor inside the area.
Moffat's stunning curling effort two minutes later completed the turnaround before the visitors were handed a major advantage when Brian Kerr picked up his second yellow card in the 54th minute.
The in-form striker earned his hat-trick after 72 minutes, again with a spot-kick, after Scott Brown upended Liam Buchanan.
Moffat then gave the away side an unassailable lead three minutes later as he recorded his 20th goal of the season with a low drive from the edge of the area.