Malaysia's former premier Mahathir Mohamad said on Thursday Muslims have a right to "punish the French" but he did not approve of the killing of a French teacher over his use of cartoons of the Prophet.
In a blog post, Mahathir, 95, a respected leader in the Muslim world, said he believed in freedom of expression but that it should not be used to insult others.
"Since you have blamed all Muslims and the Muslims' religion for what was done by one angry person, the Muslims have a right to punish the French," he said.
Twitter said the message violated its rules about glorifying violence, but it determined that it may be in the public's interest for the post to remain.
Several Muslim-majority countries have denounced remarks by French officials, including President Emmanuel Macron, defending the use of cartoons of the Prophet Mohammad in a French school classroom. The caricatures are seen as blasphemous by Muslims.
The dispute flared after a French teacher who showed his pupils satirical cartoons of the Prophet during a civics lesson was later beheaded in the street by an attacker of Chechen origin.
French officials said the killing was an attack on the core French value of freedom of expression and defended the right to publish the cartoons. Macron has also said he would redouble efforts to stop conservative Islamic beliefs subverting French values.