Senegal have been reinstated as Africa Cup of Nations champions after the Court of Arbitration for Sport (CAS) overturned the Confederation of African Football's (CAF) decision to strip them of the title.
A unanimous ruling by a three-member CAS panel on Tuesday restores Senegal's 1-0 victory over Morocco in January's final in Rabat, setting aside the CAF Appeal Board's decision to award the hosts a 3-0 win by forfeit.
The dispute centred on Senegal's decision to leave the pitch in protest after Morocco were awarded a late penalty. The players eventually returned, the match resumed and Senegal went on to win in extra time.
CAS ruled that the referee's decision to restart the game fell within his authority and that he had committed no error of law.
"The referee's decision to resume the match or to stop it fell definitively within his sole authority," the court said.
It added that, by blowing his whistle to restart play, Jean-Jacques Ndala had determined that the conditions for resuming the match had been met, with both teams back on the pitch and willing to continue.
The ruling overturns the CAF Appeal Board's decision of 17 March, which found Senegal had breached tournament regulations by leaving the field without the referee's authorisation and declared the team to have forfeited the final.
Why CAS restored Senegal's AFCON title
The controversy erupted in the closing stages of normal time in Rabat, with Senegal already unhappy after a goal had been disallowed for a foul shortly before Morocco were awarded a penalty.
Ndala initially allowed play to continue after El Hadji Malick Diouf pulled back Brahim Diaz in the penalty area, but he was sent to the pitchside monitor by the video assistant referee and subsequently pointed to the spot.
Senegal coach Pape Thiaw called his players towards the touchline in protest, with several heading towards the dressing room. Play was delayed for around 14 minutes before the team returned.
Diaz then attempted a Panenka-style penalty, but his effort was comfortably saved by Senegal goalkeeper Edouard Mendy.
The match went into extra time, where Pape Gueye scored the only goal to give Senegal a 1-0 victory and what appeared to be their second AFCON title.
Morocco subsequently challenged the result, arguing that Senegal's walk-off breached Articles 82 and 84 of the tournament regulations. CAF's Disciplinary Board initially rejected the protest, but its Appeal Board later overturned that decision and awarded Morocco a 3-0 victory.
Senegal appealed to CAS, with the case heard by a three-member panel in Lausanne on 8 October.
The panel's ruling ultimately centred on the referee's authority to decide whether the match should resume. Ndala had allowed play to restart and the final was completed, meaning the result on the pitch could not be overturned on the basis relied upon by CAF's Appeal Board.
Senegal regain the title after months of uncertainty
The decision brings an end to a lengthy dispute over the outcome of one of the most controversial finals in AFCON history.
Senegal's football federation immediately celebrated the ruling, posting a picture of the team lifting the trophy in January with the caption "again and always".
CAF president Patrice Motsepe had previously said the organisation would respect the CAS decision, although CAF had not issued a response at the time of the ruling.
Morocco's football federation had also yet to comment.
The CAS decision restores Senegal's status as continental champions, with their victory in Rabat now officially standing. The legal battle may be over at the sports arbitration level, although CAS decisions can be challenged at Switzerland's Supreme Court on limited procedural grounds.