The CPFC 2010 consortium has agreed a deal to save Crystal Palace from extinction.
The administrator in charge of the Coca-Cola Championship club, who have debts of £30million, gave them until 3pm on Tuesday to reach an agreement with Lloyds Bank before the liquidation process was due to begin.
Hundreds of Palace fans who had gathered outside the bank's headquarters to demonstrate were fearing the worst when that deadline passed.
But negotiations were continuing behind closed doors and the deal has now been struck, saving the 105-year-old club from going out of business in the nick of time.
A statement from Lloyds Bank read: "(Stadium administrator) PricewaterhouseCoopers has reached an agreement in principle with CPFC 2010 in relation to the sale of Selhurst Park.
"This enables the consortium to go ahead with the purchase of both the Crystal Palace Football Club and Selhurst Park.
"Lloyds Banking Group has worked hard throughout this process to achieve a durable solution. We are pleased a successful conclusion has now been reached.
"We are also pleased that PwC, which acts on behalf of Selhurst Park, has publicly acknowledged today the ongoing support it has received from Lloyds Banking Group."
CPFC 2010 are confident the takeover can proceed now their differences with Bank of Scotland, a subsidiary of Lloyds which is selling Selhurst Park, have been resolved.
A statement from the consortium read: "We can now confirm that there are no material differences between ourselves and Bank of Scotland regarding the sale of Selhurst Park.
"While it is not 100% done we are confident that all the main barriers have been removed."