Kyle Turner's late penalty secured all three points for Partick Thistle as they edged to a Scottish Championship win over Ayr United.
George Oakley thought he had found a late leveller for the visitors, but his effort was disallowed for a foul.
Thistle's victory at Firhill moves them within two points of the visitors, who sit third in the Championship.
They also extended their run to eight games without defeat, while Scott Brown's side suffered their first loss in four.