The ruling stakes as West African leaders prepare to meet on Sunday to respond to the takeover, which has put the transition back to democracy back in jeopardy and could weaken a regional fight against Islamic militants.
Goita became the interim vice president after leading the coup last August that overthrew President Ibrahim Baubkar. He ordered the arrest of President Bah Nadav and Prime Minister Moktor Owne on Monday.
Both of them resigned on Wednesday while in custody. He was later released.
The court said in its ruling that Goita should fill the vacancy left by Ndaw’s resignation “to take the transition process to its conclusion” and hold the title of “President of Transition, Head of State”.
The ruling set Mali on a path of confrontation with the 15-member Economic Community of West African States (ECOWAS), which insisted that the transition, which ends with elections in February, will remain citizen-led.
After agreeing to lift the sanctions imposed after the coup against Keita in October, ECOWAS said in an announcement that the vice president of transition “cannot replace the president under any circumstances.”
The ECOWAS heads of state are scheduled to meet in Ghana on Sunday.
They and Western powers, including France and the United States, fear that the political crisis could increase instability in northern and central Mali, a domestic base for regional allies of al Qaeda and the Islamic State.
Goita, a 38-year-old Special Forces commander, was one of several colonels who led the coup against Keita. He ousted Ndaw after the interim president was named to a new cabinet, which snatched two other coup leaders from his ministerial positions.
Late Friday night, Goita said on national television that he would name the new Prime Minister from among the members of the M5-RFP alliance, who protested against Keita last year and fell out with Ndaw and Ouane during the transition Was.
Coalition member Jamille Bitter said her choice for the post would be former government minister Choguel Maiga.