Dunfermline have won their appeal against their expulsion from this season's Scottish Cup, the Scottish Football Association have confirmed.
An independent appeals panel have ordered their fourth-round tie against Stenhousemuir be replayed, but at Ochilview, and have fined the Pars approximately £30,000.
The verdict also resurrected the club's bid for a lucrative meeting with Celtic in the fifth round.
The First Division side were kicked out of the cup by a Scottish Football Association emergency committee last week following a number of breaches of the competition rules.
The Pars' expulsion came partly as the result of fielding Calum Woods, who came off the bench in the second half of the 7-1 win over Stenhousemuir on January 9, despite the SFA's official suspensions list declaring him banned for the match.
The club were also punished for further administrative errors during the tie at East End Park, including submitting an inaccurate team line, altering a named substitute and not registering two outfield under-21 players.
The SFA claimed the integrity of the competition was paramount in their decision to expel Dunfermline from the tournament but the club hit back claiming the punishment was ''excessive''.
The victory was a partial one for the club and director of football Jim Leishman said: ''We can still only apologise to the Dunfermline fans that we are in this situation but we are delighted that we are still in the cup.
''Last week, we thought we were out the cup but we got the chance to present our case and we are delighted to have the opportunity to go forward.''
He added: ''We got a fair hearing. ''We will be making an official statement but, as I say, we can only apologise but we are delighted.
On the £30,000 fine, he said: ''That's something that comes with the judgment. I can't say too much on that but we are looking forward to the game. Stenhousemuir have been magnificent in this. They haven't said anything against it, they have went with the judgment.''
Despite Leishman's praise for Stenhousemuir, their boss John Coughlin was far from happy that the possibility of a glamour tie against Celtic - and the financial rewards from hosting the Glasgow giants - could again be snatched away.
He told: ''I'm not pleased at all that there's a replay. I'm disappointed for everybody associated with the football club. I thought there was an opportunity for us to go and play against one of the best teams - if not the best team - in the country.
''That was something that obviously got the players on a high and it's going to be a difficult job to try to pick them up again. But, such is life - we just have to get on with it.
''That's the situation: we had no control over it at the start, we've no control over it now. So we'll hopefully take the opportunity to play Dunfermline in the replay and do a lot better than we did in the first game. On the positive aspect, we were out of the cup, we got soundly beaten, we've been given another chance.''
Coughlin added: ''There was the possibility the Sky cameras would have taken the game as well. You're talking about probably £70,000-£80,000 for that on top of the gate. It's well over £100,000. That can effectively be the difference between having a very good season and having an average season.''