A former aide to Malian President Ibrahim Boubacar Keita has apologised for posting expletive-laden tweets on the president's official Twitter account.
The tweets had condemned US President Donald Trump for ordering the killing of Iranian commander Qasem Soleimani, the AFP news agency reports.
They were posted on Monday and have since been deleted, but were widely shared.
The Malian government explained that the president's account had been "temporarily pirated by ill-intentioned individuals", AFP said.
President Keita's former spokesperson, Tiegoum Maiga, said he had authored the tweets.
"It was neither pirates, nor hackers, (but) a regrettable handling error," he said in French on his own Twitter account.
Compte twitter de la Présidence. Ni pirates, ni hackers, une regrettable erreur de manipulation. Hier, en voulant tweeter sur la crise americano-iranienne, je me suis retrouvé sur le compte de la Présidence, dont je possédais les clé, par erreur. Aucune volonté de nuisance.
— tiegoum maiga (@algayta) January 7, 2020
Mr Maiga said the tweets were meant for his personal account and that he had forgotten he still had access to the president's account.
He left his job as the president's aide in November.