Morocco can play in 2017 and 2019 African Nations Cup qualifying after the Court of Arbitration for Sport (CAS) upheld "in large part" an appeal against Confederation of African Football (CAF) sanctions.
CAF had barred Morocco from the 2015 edition, after the country refused to host the competition citing Ebola virus fears, and suspended them from the 2017 and 2019 editions while also imposing a fine of $1m.
"The suspension ... of the next two editions of the African Nations Cup ... is annulled and the fine imposed to the Royal Federation of Moroccan Football is reduced to $50,000," CAS said in a statement.
CAS has not ruled on CAF's claim for $9.1m in damages to itself and television and marketing partners for having to move this year's finals to Equatorial Guinea at late notice.
"The question related to the compensation of the possible damage caused by the Royal Moroccan Football Federation to the CAF may still be examined by another jurisdiction," said the Swiss-based organisation based in Lausanne.
In January, CAF's executive committee found the federation financially liable for costs after Morocco had been officially stripped of hosting rights two months earlier.
Morocco appealed to CAS, sport's highest tribunal, and accused CAF of being against the development of the game in Africa by refusing them permission to participate in the 2017 and 2019 editions.
Thursday's announcement will be a blow to CAF president Issa Hayatou who took a hardline stance against the country's initial request to postpone this year's finals for several months because of the fight against Ebola in west Africa.
Last week Tunisia withdrew a CAS appeal against a similar sanction after CAF had threatened to ban the country from 2017 qualifying unless they apologised for accusing African football's governing body of bias.
As part of a compromise, Tunisia will be allowed to play in qualifying that starts in June.