Assimi Goita was named interim president after he led a successful ouster of the former President Ibrahim Boubacar Keïta. [Courtesy]

The office of the President of Mali, Assimi Goita, has assured its citizens of the safety of their head of state after unknown men attacked him at a mosque in Bamako.

Goita’s office said he was ‘safe and sound’ after his security detail thwarted the duo's attempt on his life.

Reports by international media, AFP, indicated that two armed men attacked Mali's interim president armed with a knife, on Tuesday, July 20.

 “The attacker was immediately apprehended, the president was driven straight to a military barracks outside the city,” Office of the president told BBC.

However, AFP reported Goita had been taken away from the scene adding it was not clear whether he was wounded.

The head of state was attending Muslim prayers to mark the Islam festival Eid Al Adha.

Eid al-Adha is an Arabic meaning ‘Festival of the Sacrifice’. It honours the willingness of Abraham to sacrifice his son Ishmael as an act of obedience to God's command.

The attack raises concern for a country battling security challenges, that saw Goita lead a coup as a colonel in August 2020.

As a result of the coup, elected president Ibrahim Boubacar Keita was ousted after weeks of protests and riots over corruption and security challenges.

Goïta is seen as a controversial figure, having participated in two military coups in less than 12 months.

He declared himself president in May after ousting the interim government that had been installed after he led a coup against former President Ibrahim Boubacar Keïta last August, Paris-based France 24 reports.