The Court of Arbitration for Sport (CAS) has upheld a decision by Fifa to refuse Munir El Haddadi permission to play for Morocco.
The Morocco Football Federation (FRMF) had applied to Fifa for permission for Sevilla's El Haddadi to swap national allegiances from Spain, who he had played for in the past.
The FRMF had been hoping to take advantage of a recent Fifa rule change that allows players under 21 to change national teams even if they have played up to three competitive games.
In September Fifa decided that as El Haddadi had played for the Spanish under-21 side after his 21st birthday he did not meet the criteria to switch to Morocco.
CAS has now upheld that decision, without elaborating on its reasons, and so ending the 25-year-old's chances of playing for the Atlas Lions.
- Munir El Haddadi and Morocco take advantage of Fifa rule change
- Cas rejects Munir El Haddadi's Morocco switch
The former Barcelona player had trained with Morocco during the last international break before being told he was not cleared to play for them.
El Haddadi had tried to make the change before the rule change but was first prevented from doing so as he had made a brief substitute appearance for Spain in European Championship qualifier.
Under the the old Fifa regulations, that appearance prevented him from playing for Morocco - a decision that was also upheld by CAS.
As El Haddadi was 19 for his lone appearance for Spain, the path had seemed clear for a switch under the regulation change that had been proposed by FRMF.