A young police officer has been injured after a man attacked him with a knife at a police station in Toulouse, France.

The suspect tried to grab the officer’s weapon and when the attempt failed, he took a knife and stabbed him in the neck, according to a statement by the police trade union Unite SGP Police-FO.

The officer's life is said not to be in danger.

La Depeche du Midi has posted a video from the scene of the attack.

La rue du Rempart Saint-Etienne, à #Toulouse, où a eu lieu l'agression est bouclée par la police. pic.twitter.com/E6Ar0MQqsS — La Dépêche 31 (@ladepeche31) August 30, 2016

The incident took place in the Rempart Saint-Etienne prefecture of Toulouse.

The assailant, 31, had a psychiatric disorder and attacked the officer because he “represented France,” La Depeche du Midi news outlet reported.

Agression au couteau dans le commissariat de Toulouse, on n'en sait pas plus #Toulousepic.twitter.com/YCeaJJ0nKs — Pierre Adrian (@PierreA31) August 30, 2016

The attacker, who had entered the police station under the pretext of making a complaint, was arrested at the scene.

The assailant was of Algerian origin, La Depeche Du Midi reported, although this has not been officially confirmed.

France has been on high alert following a series of Islamic State (IS, formerly ISIS/ISIL)-linked attacks since January 2015. The largest loss of life came in November 2015 when at least 130 people were killed in Paris. Following that attack, France introduced a state of emergency, which is ongoing.

A tragedy in Nice on July 14 of this year killed at least 84 people when a truck driven by an IS sympathizer plowed through a crowd during Bastille Day celebrations.

In July, France was shaken by the murder of Father Jacques Hamel in Saint-Etienne-du-Rouvray, northern France, by two purported IS militants. The 85-year-old was killed when his throat was slit during a hostage situation at the local church. French police killed the IS-inspired attackers, Adel Kermiche and Abdel Malik Petitjean, both 19, as they tried to flee the church.

Neighboring Belgium is also on high alert, following bombings in Brussels in March. The community was shaken again earlier in August when two female officers were injured in a machete attack in the city of Charleroi.