A supporters' group was today given the go-ahead to take control of troubled npower League One club Portsmouth.
Accountants managing affairs since the club was placed into administration 14 months ago said a problem relating to the sale of the Fratton Park stadium had been solved - paving the way for the Pompey Supporters' Trust (PST) to complete a buyout.
Trust members said a club takeover by supporters was "ground-breaking" and bigger news for Portsmouth fans than an FA Cup win.
A High Court judge had been due to analyse issues relating to the sale of the ground at a hearing in London.
But lawyers told judge Mr Justice Peter Smith that an agreement had been reached between BDO - the firm acting as administrators - and the club's former owner.
The judge said he was pleased that an agreement had been reached and that Portsmouth would be preserved.
Fans who had travelled to the High Court from the south coast applauded and cheered when the hearing ended.
PST chairman Ashley Brown welcomed the agreement, saying in a statement: "This is a historic day for Portsmouth Football Club and for Pompey fans everywhere.
"At last, the tough work done over the last year is over and we can start to rebuild our club. Pompey fans are now days away from owning and running our club and becoming the biggest community owned football club in the country.
"We have a lot of people to thank, and much more to say, but will do that once the details of today's settlement are finalised.
"For now, we would like to offer heartfelt thanks to Pompey fans all over the world who have pledged money and have saved our club from liquidation.
"Now the next chapter of hard work begins to transform our club into something the community of Portsmouth can be proud of, both on and off the field."
Iain McInnes, the prospective chairman of PFC commented: "If you believe you can do something you can - and we have."
Trust director Mark Trapani - a Portsmouth car dealership boss - said the club would become Portsmouth Community Football Club Ltd.
"I think there will be clubs around the country that will look at what we have done and probably say 'this is the way forward'," he said.
"For me this is a greater day than the day Portsmouth won the FA Cup in 2008. That was one day. This is the future. The fans should see it like that too."
Trust member Jo Collins added: "This is ground-breaking for football clubs."
Mr Justice Peter Smith, who said he was a Hull fan, had told the court the agreement would enable the trust to take control.
"I am very pleased that the parties have agreed provisions which will preserve the club," he said. "On we go with the last three games."
Trevor Birch, a BDO partner and a joint administrator of Portsmouth, said outside court: "We were appointed to secure the best deal for creditors and today's developments enable us to fulfil that obligation."
He added: "The past year has been incredibly challenging for everyone involved with the club - fans, staff and players - and I want to thank them all for their support.
"They deserve credit for keeping Portsmouth Football Club alive despite what, at times, seemed like insurmountable obstacles and I'm sure that their actions will inspire supporters' groups at other clubs."