The Court of Arbitration for Sport (CAS) on Thursday scrapped sanctions dished out by the Confederation of African Football (CAF) to Morocco, freeing the North African country to play in the 2017 and 2019 Africa Cup of Nations.
CAF hit Morocco's football federation (FRMF) with the ban and a fine of $1 million (880,000 euros) after it decided not to host the 2015 Cup of Nations amid fears over the Ebola crisis.
CAS said it "has upheld the appeal in a large proportion".
"The sanctions imposed by the CAF on the FRMF have been set aside, with the exception of the fine, which is however reduced to $50,000."
CAF had also ordered the Moroccan federation to pay 8 million euros ($9m) "for damages caused to the Confederation of African Football (CAF) and partners".
And CAS, the highest appeal court in world sport, said the "question related to the compensation of the possible damage caused by the FRMF to the CAF may still be examined by another jurisdiction".
The Moroccan federation had called for the 2015 tournament, eventually moved at the last minute to Equatorial Guinea and won by Ivory Coast on February 8, to be delayed as concerns over the potential spread of the Ebola virus grew, and then declined to host it when that delay was not granted.
The African division of global players' union FIFPro have hit out at African football bosses for their treatment of Morocco.
(For more sports news and updates, follow Ahram Online Sports on Twitter at @AO_Sports and on Facebook at AhramOnlineSports.)