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 the 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."
- Sports & Recreation
- Portsmouth Football Club