Caster Semenya has been invited to compete in the Diamond League meeting in Rabat this weekend after initially being denied entry.
Semenya was again cleared to compete without restriction on Thursday when the Federal Supreme Court of Switzerland (SFT) rejected an IAAF request to reimpose a new ruling limiting testosterone in female athletes.
The double Olympic 800 metres champion is challenging the IAAF's decision to introduce restrictions on testosterone levels in women competing at distances ranging from 400m to a mile.
Semenya should be free to run while she awaits an SFT verdict on her case, but was told on Tuesday that the president of the Moroccan Athletics Federation would not permit her to compete in Rabat on Sunday.
Race organisers backtracked after taking note of the SFT's refusal to reimpose the IAAF ruling.
A statement released by race organisers on Friday said: "After checking the situation of Caster Semenya in view of the decisions of the Swiss Federal Court, and the Court of Arbitration for Sport, the head of the sports centre and sports organisation of the international athletics meeting in Rabat, Mr. Alain Blondel, is happy to confirm her invitation to participate in the 800m race of the said meeting on Sunday 16 June 2019."
Semenya is also hoping to run in the Prefontaine Classic Diamond League meeting in California on June 30.