The incident happened during prayers at the Grand Mosque in the capital Bamako to mark the Muslim holiday of Eid al-Adha.
Goita was initially interim vice president after he overthrew President Ibrahim Boubacar Keita after leading a coup last August.
In May, he ordered the arrest of President Bah Nadav and Prime Minister Moctor Ouane, who resigned shortly after while in custody. Later both were released.
The court, in its ruling, said that Goita should fill the vacancy left by Endow’s resignation “to take the transition process to its conclusion” and assume the title of “President of the Transition, Head of State”.
The ruling set Mali on a collision course with the 15-member Economic Community of West African States (ECOWAS), which insisted that the transition, which is set to end with elections in February, would remain citizen-led.
The AU’s Peace and Security Council said, “The AU called for “a seamless, transparent and swift return to civilian-led transition … failing which, the Council will not hesitate to impose targeted sanctions.”
Mali’s neighbors and international powers feared the uprising would jeopardize commitments to hold presidential elections in February, and undermine a regional fight against Islamist militants, some of whom are based in Mali’s desert.