Everyone should “work together” to counter extremism following a terror attack in France, the Government’s Islamophobia adviser has said.

History teacher Samuel Paty was beheaded near Paris on Friday after previously being threatened for discussing caricatures of Islam’s Prophet Mohammed with his class, according to French police.

The suspect, an 18-year-old Chechen refugee unknown to intelligence services, was shot dead by police – and officials have opened a murder investigation with a “suspected terrorist motive”.

Islam prohibits images of the prophet, proclaiming they lead to idolatry.

Qari Asim MBE, Imam of Makkah Mosque and Government adviser on Islamophobia, spoke out to condemn the “barbaric and gruesome acts of violence”, saying the incident “can never be justified in the name of Islam”.

He also urged Britons not to be divided by the “hateful rhetoric” of Islamist extremists.

Mr Asim said: “We are all dismayed to know yet another life has been lost because of an act of terror in Paris.

“Such barbaric and gruesome acts of violence can never be justified in the name of Islam; such cowardice further taints our peaceful religion and increases hostility towards Muslims globally.

“We must all value and defend freedom of expression and belief. At the same time we should respectfully help those who may not hold the same beliefs as us to understand the deep hurt that we may feel when we perceive our faith to be undermined.

“As an Imam, I urge everyone to work together to counter divisive and hurtful narratives and not give rise to those that seek to exploit it. Extremists look to divide us but we must not play into their hateful rhetoric.”.

France’s anti-terrorism prosecutor’s office said authorities investigating the killing of Mr Paty in Conflans-Sainte-Honorine arrested nine suspects, including the teenager’s grandfather, parents and 17-year-old brother.

French anti-terrorism prosecutor Jean-Francois Ricard said an investigation for murder with a suspected terrorist motive had been opened.

Mr Ricard told reporters that the Moscow-born suspect, who had been granted a 10-year residency in France as a refugee in March, was armed with a knife and an airsoft gun, which fires plastic pellets.