Dunfermline Athletic beat Ayr United in a replay to set up a Scottish Cup fifth-round meeting with Rangers.

Ryan Thomson came close to opening the scoring in the first half, his effort saved well by visiting goalkeeper David Hutton.

But Thomson headed the Pars in front from Alex Whittle's cross on the hour mark.

Michael Moffat headed wide and was then denied by a fine Ryan Scully block as Ayr tried to force a leveller.

But Dunfermline avoided extra-time, to the delight of the home fans.

Saturday's meeting of the two sides had ended 1-1 with Ayr coming back to force the replay.

And the combined threat of Thomson and Ryan Wallace caused Ayr problems at East End Park, with the former denied by a fine save from Hutton midway through the first half.

Ryan Thomson celebrates after scoring for Dunfermline against Ayr United

Thomson's goal secured Dunfermline a trip to Ibrox

The Pars dominated possession as half-time approached but could not break down their visitors.

However, Dunfermline got a reward for their pressure when Thomson nodded Whittle's cross towards goal and Hutton could not keep the effort out.

Ayr tried to respond but Moffat was unable to direct his header on target.

And, after Dunfermline's Alan Smith had fired wide, Moffat came close to levelling for Ayr.

The forward unleashed a shot from the middle of the penalty area only for Scully to make an impressive save.

And that proved crucial in securing the Fife side's place in the next round.

Jim Jefferies' men, who are currently trailing leaders Rangers in Scottish League One, will visit Ibrox when the fifth round takes place in February .

Dunfermline forward Craig Dargo: "Over the piece I thought we dominated a bit but Ayr are a very astute team and they were dangerous on the counter.

"I thought the win was deserved and it was a great goal by Ryan Thomson.

"Ayr were hard to break down. With the amount of possession we had, I felt it was only going to take time. If we kept doing the right things we'd get our goal and thankfully we did.

"We knew what was at stake, we knew we had a trip to Rangers and we've already played them and there wasn't too much between the teams so it should be a mouth-watering tie."

Ayr United player-manager Mark Roberts: "When they got the goal, we probably played for half-an-hour when we had a go at them.

"For me, it's too little, too late. If we had done that from the first whistle, we'd probably have had a real chance of still being in the cup.

"The guys gave everything in the last half-hour but it wasn't to be.

"To be fair, Dunfermline deserved to win."

Lineup, Bookings (7) & Substitutions (4)

Dunfermline

  • 01 Scully
  • 02 Millen Booked
  • 03 Whittle
  • 07 Byrne
  • 04 Young Booked
  • 05 Morris Booked
  • 06 Geggan
  • 10 Falkingham
  • 09 Wallace (Husband - 93' )
  • 08 Smith (Dargo - 74' )
  • 11 Thomson Booked

Substitutes

  • 12 Moore
  • 14 Dargo
  • 15 Martin
  • 16 Husband
  • 17 Ferguson
  • 18 Williamson
  • 20 Goodfellow

Ayr United

  • 01 Hutton
  • 02 Hunter Booked
  • 03 Pope Booked
  • 06 Gilmour
  • 04 McLaughlin
  • 05 Lithgow
  • 07 Marenghi Booked (Malcolm - 68' )
  • 08 Crawford (Forrest - 60' )
  • 10 Kyle
  • 09 Moffat
  • 11 Donald

Substitutes

  • 12 Malcolm
  • 14 Forrest
  • 15 McGowan
  • 16 McCracken
  • 17 Wardrobe
  • 18 Longridge
  • 19 Muir
Ref: Stephen Finnie
Att: 1,932

Match Stats

Shots

16 5

On target

6 3

Corners

13 4

Fouls

10 17

Live Text Commentary

Full time

Full Time Match ends, Dunfermline Athletic 1, Ayr United 0.

90:00 +4:24 Full time

Full Time Second Half ends, Dunfermline Athletic 1, Ayr United 0.

90:00 +3:00

Josh Falkingham (Dunfermline Athletic) wins a free kick in the defensive half.

90:00 +3:00

Foul by Craig Malcolm (Ayr United).

90:00 +2:10 Substitution

Substitution Substitution, Dunfermline Athletic. Stephen Husband replaces Ryan Wallace.

90:00 +1:23

Shaun Byrne (Dunfermline Athletic) wins a free kick in the defensive half.

90:00 +1:23

Foul by Gordon Pope (Ayr United).

90:00 +0:07

Corner, Ayr United. Conceded by Kerr Young.

89:25

Attempt saved. Shaun Byrne (Dunfermline Athletic) left footed shot from the centre of the box is saved in the centre of the goal.

86:09

Attempt saved. Michael Moffat (Ayr United) right footed shot from the centre of the box is saved in the bottom right corner.

84:18

Ross Millen (Dunfermline Athletic) wins a free kick in the attacking half.

84:18

Foul by Kevin Kyle (Ayr United).

82:29

Foul by Josh Falkingham (Dunfermline Athletic).

82:29

Michael Donald (Ayr United) wins a free kick in the defensive half.

81:08

Andrew Geggan (Dunfermline Athletic) wins a free kick in the defensive half.

81:08

Foul by Brian Gilmour (Ayr United).

80:06

Attempt saved. Ryan Wallace (Dunfermline Athletic) right footed shot from the centre of the box is saved in the centre of the goal.

78:07

Corner, Ayr United. Conceded by Kerr Young.

75:15

Corner, Ayr United. Conceded by Callum Morris.

73:33 Substitution

Substitution Substitution, Dunfermline Athletic. Craig Dargo replaces Allan Smith.

73:19

Attempt missed. Allan Smith (Dunfermline Athletic) right footed shot from the right side of the box is too high.

72:28

Attempt missed. Josh Falkingham (Dunfermline Athletic) left footed shot from outside the box is high and wide to the left.

72:07

Corner, Dunfermline Athletic. Conceded by Gordon Pope.

69:06

Attempt missed. Michael Moffat (Ayr United) header from the centre of the box is close, but misses to the left.

67:17 Substitution

Substitution Substitution, Ayr United. Craig Malcolm replaces Anthony Marenghi.

66:52

Ryan Wallace (Dunfermline Athletic) wins a free kick on the left wing.

66:52

Foul by Adam Hunter (Ayr United).

64:51

Allan Smith (Dunfermline Athletic) wins a free kick on the right wing.

64:51

Foul by Brian Gilmour (Ayr United).

62:54 Booking

Booking Adam Hunter (Ayr United) is shown the yellow card.

62:43

Foul by Allan Smith (Dunfermline Athletic).

62:43

Adam Hunter (Ayr United) wins a free kick on the left wing.

61:24 Booking

Booking Anthony Marenghi (Ayr United) is shown the yellow card.

61:21

Josh Falkingham (Dunfermline Athletic) wins a free kick in the defensive half.

61:21

Foul by Anthony Marenghi (Ayr United).

60:32

Foul by Shaun Byrne (Dunfermline Athletic).

60:32

Michael Donald (Ayr United) wins a free kick in the defensive half.

59:38 Substitution

Substitution Substitution, Ayr United. Alan Forrest replaces Robert Crawford.

59:05 Goal scored

Goal! Goal! Dunfermline Athletic 1, Ayr United 0. Ryan Thomson (Dunfermline Athletic) header from the centre of the box to the bottom right corner. Assisted by Alex Whittle with a cross.

56:48

Ryan Thomson (Dunfermline Athletic) wins a free kick in the attacking half.

56:48

Foul by Scott McLaughlin (Ayr United).

55:20

Josh Falkingham (Dunfermline Athletic) wins a free kick in the defensive half.

55:20

Foul by Michael Donald (Ayr United).

52:13

Corner, Dunfermline Athletic. Conceded by Michael Donald.

51:27 Booking

Booking Gordon Pope (Ayr United) is shown the yellow card.

51:17

Shaun Byrne (Dunfermline Athletic) wins a free kick in the defensive half.

51:17

Foul by Gordon Pope (Ayr United).

47:08

Attempt missed. Ross Millen (Dunfermline Athletic) right footed shot from the right side of the box is too high.

46:43

Hand ball by Brian Gilmour (Ayr United).

46:00

Corner, Dunfermline Athletic. Conceded by Gordon Pope.

45:00

Second Half begins Dunfermline Athletic 0, Ayr United 0.

45:00 +0:31 Half time

Half Time First Half ends, Dunfermline Athletic 0, Ayr United 0.

45:00 +0:19

Attempt missed. Kerr Young (Dunfermline Athletic) right footed shot from the left side of the box is high and wide to the right.

44:53

Corner, Dunfermline Athletic. Conceded by Gordon Pope.

43:51

Attempt blocked. Ryan Thomson (Dunfermline Athletic) left footed shot from the centre of the box is blocked.

43:28

Corner, Dunfermline Athletic. Conceded by Gordon Pope.

42:31

Attempt missed. Callum Morris (Dunfermline Athletic) header from the centre of the box is too high.

42:00

Josh Falkingham (Dunfermline Athletic) wins a free kick in the attacking half.

41:53

Foul by Anthony Marenghi (Ayr United).

41:07 Booking

Booking Ross Millen (Dunfermline Athletic) is shown the yellow card.

39:24

Corner, Dunfermline Athletic. Conceded by Gordon Pope.

36:43

Corner, Dunfermline Athletic. Conceded by Scott McLaughlin.

36:21

Attempt saved. Callum Morris (Dunfermline Athletic) right footed shot from the centre of the box is saved in the centre of the goal.

35:56

Corner, Dunfermline Athletic. Conceded by Gordon Pope.

35:42

Attempt saved. Kevin Kyle (Ayr United) right footed shot from the centre of the box is saved in the centre of the goal.

34:42

Foul by Adam Hunter (Ayr United).

34:42

Ryan Wallace (Dunfermline Athletic) wins a free kick in the defensive half.

34:14

Corner, Ayr United. Conceded by Ryan Wallace.

33:52

Robert Crawford (Ayr United) wins a free kick in the attacking half.

33:52

Foul by Ryan Wallace (Dunfermline Athletic).

32:01 Booking

Booking Ryan Thomson (Dunfermline Athletic) is shown the yellow card.

31:54

Ryan Thomson (Dunfermline Athletic) has gone down, but that's a dive.

29:57

Foul by Michael Moffat (Ayr United).

29:57

Kerr Young (Dunfermline Athletic) wins a free kick in the defensive half.

29:08

Foul by Kevin Kyle (Ayr United).

29:08

Callum Morris (Dunfermline Athletic) wins a free kick in the attacking half.

28:37

Brian Gilmour (Ayr United) wins a free kick on the right wing.

28:37

Foul by Andrew Geggan (Dunfermline Athletic).

27:38

Foul by Adam Hunter (Ayr United).

27:38

Ryan Wallace (Dunfermline Athletic) wins a free kick in the defensive half.

27:12

Corner, Dunfermline Athletic. Conceded by Alan Lithgow.

27:03

Attempt blocked. Josh Falkingham (Dunfermline Athletic) right footed shot from outside the box is blocked.

26:51

Corner, Dunfermline Athletic. Conceded by David Hutton.

26:22

Attempt saved. Ryan Thomson (Dunfermline Athletic) right footed shot from the centre of the box is saved in the bottom right corner.

24:20

Attempt missed. Josh Falkingham (Dunfermline Athletic) right footed shot from outside the box is high and wide to the left.

23:41 Booking

Booking Callum Morris (Dunfermline Athletic) is shown the yellow card.

19:36 Booking

Booking Kerr Young (Dunfermline Athletic) is shown the yellow card.

19:26

Michael Moffat (Ayr United) wins a free kick in the defensive half.

19:26

Foul by Kerr Young (Dunfermline Athletic).

18:14

Attempt blocked. Ryan Wallace (Dunfermline Athletic) right footed shot from outside the box is blocked.

16:20

Attempt missed. Robert Crawford (Ayr United) right footed shot from the centre of the box is close, but misses to the right.

15:42

Kevin Kyle (Ayr United) wins a free kick in the attacking half.

15:42

Foul by Kerr Young (Dunfermline Athletic).

15:01

Attempt saved. Ryan Thomson (Dunfermline Athletic) right footed shot from the centre of the box is saved in the centre of the goal.

13:05

Attempt saved. Michael Donald (Ayr United) right footed shot from the centre of the box is saved in the centre of the goal.

10:10

Foul by Robert Crawford (Ayr United).

10:10

Josh Falkingham (Dunfermline Athletic) wins a free kick in the defensive half.

9:11

Kevin Kyle (Ayr United) wins a free kick in the defensive half.

9:11

Foul by Josh Falkingham (Dunfermline Athletic).

6:47

Corner, Dunfermline Athletic. Conceded by Adam Hunter.

4:52

Corner, Dunfermline Athletic. Conceded by Alan Lithgow.

4:25

Attempt blocked. Josh Falkingham (Dunfermline Athletic) right footed shot from outside the box is blocked.

3:58

Corner, Dunfermline Athletic. Conceded by Gordon Pope.

1:07

Foul by Ryan Thomson (Dunfermline Athletic).

1:07

Brian Gilmour (Ayr United) wins a free kick on the right wing.

0:00

First Half begins.

0:00

Lineups are announced and players are warming up.

Live data and text provided by our data suppliers