Ryan Wallace scored twice as Dunfermline demolished Ayr 5-1.
The visitors took the lead in the second minute when Michael Moffat fired in from the middle of the box.
The Pars drew level in the 21st minute when Wallace scored from the penalty spot after Adam Hunter had fouled Andrew Geggan in the area.
Dunfermline went ahead 10 minutes later thanks to Alex Whittle's sensational left-footed strike before Geggan made it 3-1 from the right of the box shortly after.
The hosts made it 4-1 five minutes before the break when Joshua Falkingham found the top corner of David Hutton's net.
Ayr almost reduced the deficit in the 49th minute when Jackson Longridge tried his luck from distance, but his effort hit the bar.
Instead the home side extended their lead in the 65th minute when Wallace fired in from the edge of the box.