text: Dunfermline made a strong start and twice went close through Joe Carle and Michael Moffat.
  But Ayr took the lead with a Ross Docherty header which sneaked over the Pars goal line, his first goal of the season.
  Ayr clung on and defended desperately to claim all three points.
  Cardle had an early goal-bound shot cleared by Conrad Balatoni before Moffat cracked the post with a glancing headed.
  Ayr looked shaky in defence, but they dragged themselves back into the game after looking like they might be swamped by the Pars whirlwind start.
  Docherty fired wide from the edge of the 18-yard line, turning and sweeping the shot past the post.
  Dunfermline continued to threaten though and John Herron powered a header just past the post after a whipped cross from Callum Higginbotham on the right.
  Dunfermline made a flying start to the second half and Moffat immediately forced keeper Greg Fleming to tip his drive over the bar.
  But Ayr it was who struck first when Docherty powered a header down which evaded a forest of legs to cross the line.
  That emboldened them and Michael Rose and Alan Forrest brought good saves from Pars keeper Sean Murdoch in quick succession.
  Dunfermline's Joe Cardle then squandered a fine chance, sclaffing his shot wide of goal, before substitute David Hopkirk forced Fleming into a full length diving save.
  The result keeps Ayr United above St Mirren, and moves them just three points behind eighth placed Dumbarton with a game in hand.
  Match ends, Dunfermline Athletic 0, Ayr United 1.
  Second Half ends, Dunfermline Athletic 0, Ayr United 1.
  Lee Ashcroft (Dunfermline Athletic) wins a free kick in the attacking half.
  Foul by Craig Moore (Ayr United).
  Attempt missed. Nicky Clark (Dunfermline Athletic) header from the centre of the box is close, but misses to the right.
  Corner,  Dunfermline Athletic. Conceded by Conrad Balatoni.
  Michael Paton (Dunfermline Athletic) wins a free kick in the defensive half.
  Foul by Patrick Boyle (Ayr United).
  Corner,  Dunfermline Athletic. Conceded by Conrad Balatoni.
  Attempt blocked. Jason Talbot (Dunfermline Athletic) left footed shot from outside the box is blocked.
  Attempt blocked. David Hopkirk (Dunfermline Athletic) right footed shot from outside the box is blocked.
  Jason Talbot (Dunfermline Athletic) wins a free kick on the right wing.
  Foul by Michael Rose (Ayr United).
  Corner,  Dunfermline Athletic. Conceded by Greg Fleming.
  Attempt saved. David Hopkirk (Dunfermline Athletic) right footed shot from outside the box is saved in the bottom right corner.
  Substitution, Dunfermline Athletic. Gavin Reilly replaces Joe Cardle.
  Substitution, Ayr United. Gary Harkins replaces Alan Forrest.
  Attempt missed. Brian Gilmour (Ayr United) right footed shot from outside the box is close, but misses the top right corner.
  Attempt saved. Michael Paton (Dunfermline Athletic) header from the centre of the box is saved in the centre of the goal.
  David Hopkirk (Dunfermline Athletic) wins a free kick in the attacking half.
  Foul by Daryll Meggatt (Ayr United).
  Attempt saved. Alan Forrest (Ayr United) right footed shot from the centre of the box is saved in the centre of the goal.
  Substitution, Ayr United. Craig Moore replaces Farid El Alagui.
  Substitution, Ayr United. Craig McGuffie replaces Ross Docherty because of an injury.
  Attempt missed. Joe Cardle (Dunfermline Athletic) left footed shot from the centre of the box is close, but misses to the left.
  Callum Morris (Dunfermline Athletic) wins a free kick in the defensive half.
  Foul by Farid El Alagui (Ayr United).
  Substitution, Dunfermline Athletic. Michael Paton replaces Kallum Higginbotham.
  Substitution, Dunfermline Athletic. David Hopkirk replaces Michael Moffat.
  Callum Morris (Dunfermline Athletic) wins a free kick on the left wing.
  Foul by Farid El Alagui (Ayr United).
  Ryan Williamson (Dunfermline Athletic) wins a free kick in the defensive half.
  Foul by Daryll Meggatt (Ayr United).
  Corner,  Ayr United. Conceded by Sean Murdoch.
  Attempt saved. Alan Forrest (Ayr United) right footed shot from a difficult angle on the right is saved in the centre of the goal.
  Corner,  Ayr United. Conceded by Jason Talbot.
  Corner,  Ayr United. Conceded by Sean Murdoch.
  Attempt saved. Michael Rose (Ayr United) right footed shot from outside the box is saved in the top right corner.
  Foul by Callum Morris (Dunfermline Athletic).
  Farid El Alagui (Ayr United) wins a free kick in the defensive half.
target: Ayr survived relentless pressure in a brave performance to take three huge points in their battle for championship survival.