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 leading the coup last August that overthrew President Ibrahim Boubacar Keita.
In May, he ordered the arrests of President Bah Ndaw and Prime Minister Moctar Ouane who shortly resigned while in detention. The duo were later released.
The court said in its ruling that Goita should fill the vacancy left by Ndaw’s resignation “to lead the transition process to its conclusion” and carry 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 due to end with elections in February, remain civilian-led.
The AU called for “an unimpeded, transparent and swift return to the civilian-led transition … failing which, the Council will not hesitate to impose targeted sanctions,” the AU’s Peace and Security Council said.
Mali’s neighbors and international powers feared the revolt will jeopardize a commitment to hold a presidential election in February, and undermine a regional fight against Islamist militants, some of which are based in Mali’s desert north.