Southend United have agreed a takeover deal with a consortium headed by Australian businessman Justin Rees.
The sale has been announced less than 24 hours before the club are due in the High Court to face an HM Revenue & Customs winding up petition.
Southend were warned at a previous court appearance they would be put out of business unless the debt was paid.
Rees' takeover ends the 25-year tenure of Ron Martin, who announced in March he was putting the club up for sale.
A statement said: "We can confirm that an agreement for the sale of the club has been reached with a consortium led by Justin Rees.
"Everyone is working towards a completion date of 1 November 2023 - that is when the consortium will formally take control of the club.
"The collaborative approach to agreeing this deal would not have been possible without the support of creditors and the assistance from the leader of Southend City Council.
"We recognise that this has been a stressful time for all associated with the club. We would like to thank our staff for their incredible loyalty and also thank all our stakeholders for their patience."