Safety would have been assured had they beaten an Airdrie side that had already lost 24 times this season, but the Diamonds had not read the script and won 2-1 to leave Dunfermline now facing Forfar in the play-off semi-finals.
East End Park was stunned less than a minute into the second half when Airdrie took the lead through Liam Coogans’ shot home from 12 yards out. However, at that stage Dunfermline were still ahead of a Cowdenbeath side that were losing 1-0 to Hamilton.
The see-saw tipped in the Blue Brazil’s direction when they drew level at New Douglas Park but, determined to fight back from these setbacks, Dunfermline moved things back in their favour when Ryan Thomson converted an Andy Geggan pass.
That made Jim Jefferies side safe again, but that changed when Willie McLaren shot home from 25 yards on 62 minutes and panic turned to despair as news of a further two Cowdenbeath goals came through.
Dunfermline could not force a leveller or indeed a winner and Jefferies said afterwards: “We had lots of chances and did not take them. Their goal had a charmed life when we were hitting the woodwork in the first half but, overall, we were trying to lay the ball on a plate as opposed to just burying our chances.
“We now have to go into two tough games against a pretty experienced side. They will be tough matches, but we showed against Morton and Partick that we can handle tough games..”
Cowdenbeath can enjoy their summer now after their 3-1 win against Hamilton. Stevie May put the New Douglas Park side ahead after 27 minutes, but the visitors got a route back into the game when Andy Ryan was dismissed four minutes later after a clash with Thomas O’Brien.
Scott Linton’s goal drew them level on 48 minutes before Craig Moore and Marc McKenzie sealed the win.
A delighted manager, Colin Cameron, said: “I told the players that I believed that we could beat Hamilton and, if we did that, then we had a chance. Hamilton have been on a great run but I told the boys to believe.
“Even when we were winning we could not relax as we were waiting for news from Dunfermline. When it came through we enjoyed it and it is a terrific feat for us to stay in this league.”
Champions Partick Thistle ended their season with a goalless draw at Dumbarton with the Sons’ Scott Agnew coming closest to a goal when he shot against the post midway through the second half.
Morton’s disappointing end to the season continued as they went down 4-1 to Falkirk, who won under recently-appointed manager Gary Holt for the first time.
Mark McLaughlin had given the Greenock side a first-half lead, but Craig Sibbald, Lyle Taylor with a penalty, Kieran Duffie and Sean Higgins turned things around to see the Bairns finish in third place.
Raith Rovers finished on a high as they defeated hosts Livingston 3-2 with Grant Anderson putting the Kirkcaldy men ahead and Liam Fox levelling from the spot just before the break.
Brian Graham edged Raith ahead eight minutes from time before Ian Russell levelled, only for Graham to pop up with a last-gasp winner.
1st/2nd Div Play-Offs
Wednesday, 8 May: Forfar v Dunfermline (7.45pm); Brechin v Alloa (7.45pm)
Saturday, 11 May: Dunfermline v Forfar (3pm); Alloa v Brechin (3pm)
Final over two legs on 15 and 19 May