FIFA has been ordered to take "all necessary measures" to accept Gibraltar as a member "without delay" by the Court of Arbitration for Sport (CAS).
World football's governing body told the Gibraltar Football Association (GFA) that requirements for admission to FIFA "were not met" on September 26, 2014, and subsequently refused to send their application for membership to the ruling Congress.
The GFA appealed to CAS, arguing that FIFA "improperly" rejected its bid.
They asked the Lausanne based body to directly award them with FIFA membership.
CAS refused to do this, but partially upheld the GFA appeal and did rule that the application should be transferred to the FIFA Congress for approval.
"The Panel has unanimously ordered that the FIFA Congress take all necessary measures to admit the GFA as a full member of FIFA as soon as possible, within the limits of the FIFA Statute," a CAS statement said.
The matter may now be dealt with at FIFA's Congress in Mexico City between May 12 and 13.
“The judgment is far-reaching and ground-breaking,” said GFA President Michael Llamas to the Gibraltar Chronicle.
“It’s an absolutely fantastic result.
"We have conquered the Everest of world football.
“An odyssey that started back in 1997 comes to a fabulous and historic conclusion with the GFA now having achieved both UEFA and FIFA membership.”
Gibraltar, a British overseas territory at the tip of the Iberian peninsula, has been trying to join FIFA and European governing body UEFA for nearly 20 years.
A CAS ruling in 2013 saw them granted UEFA membership, and their national side went on to play in qualifying for the 2016 European Championships in France.
They played their home games at the Estádio Algarve in Portugal due to the lack of a suitable stadium within their territory and lost all ten of their matches in Group D, scoring just twice and conceding 56 times.
Their high point came when Lee Casciaro scored a shock equaliser against Scotland at Hampden Park in Glasgow, before the hosts eventually triumphed 6-1.
FIFA membership would mean that Gibraltar will be able to attempt to qualify for World Cups.
The qualifying draw has already been made ahead of Russia 2018, but they could in theory be added to one of two five-team groups that are currently set in Europe.
This could also happen to Kosovo, who are set to be approved by FIFA in Mexico City.
Gibraltar's attempts to join the international football fold have been resisted strongly by Spain, which borders the territory and disputes British sovereignty.
FIFA also had rules preventing non independent countries from joining, although these were altered in 2013.