Damian Casalinuovo's last-minute goal rescued a point for 10-man Raith Rovers against relegation rivals Ayr United.
Brian Graham's left-foot strike put the hosts ahead on 13 minutes.
But Mark Roberts' penalty in the 64th minute, awarded after Jason Thomson fouled Liam Tomsett, and Eddie Malone's free-kick 15 minutes later put Ayr in command.
However, Casalinuovo slotted home from Grant Murray's header to ensure the gap between eighth-place Ayr and second-bottom Ratih remains at two points.
Raith: McGurn, Jason Thomson, Murray, Hill (Casalinuovo 84), Dyer, Allan Walker, Ellis, Davidson, Hamill (Clarke 80), Baird (Jamie Walker 80), Brian Graham. Subs Not Used: Laidlaw, Williamson.
Sent Off: Brian Graham (38). Booked: Jason Thomson, Baird, Jamie Walker, Davidson.
Goals: Brian Graham 13, Casalinuovo 90.
Ayr: Cuthbert, Tiffoney, John Robertson, Smith, Malone, Dodd (Moffat 57), Ross Robertson, Tomsett, McGowan, Parker (Wardlaw 80), Roberts. Subs Not Used: McWilliams, McKernon, Martyn Campbell.
Booked: Malone, McGowan.
Goals: Roberts 64 pen, Malone 79.
Ref: Crawford Allan