Police have shot and injured a man who attacked three officers with a hammer near Notre Dame Cathedral in Paris while shouting "this is for Syria." The man, who injured one of the officers, was also armed with two knives, according to French media.

One officer was hit in the head with the hammer, prompting police to fire at the attacker.

"A man came behind these police officers and, armed with a hammer, started hitting one of them. His colleagues reacted with composure...and fired," French Interior Minister Gerard Collomb told reporters, as quoted by Reuters.

The man shouted "this is for Syria" as he attacked, according to Collomb.

The attacker had also threatened passersby before targeting the three police officers, according to BFM TV.

Collomb said the man carried the identity card of an Algerian student and appeared to have acted alone.

Paris police initially tweeted that an "intervention" was taking place in the square in front of the cathedral, and asked people to avoid the area.

🔴Parvis de #NotreDame Intervention en cours des effectifs de police, évitez le secteur — Préfecture de police (@prefpolice) June 6, 2017

Witnesses cited by the Telegraph said they saw a man lying on the ground at the scene.

Footage posted online by RT en Francais reporter Jonathan Moadab showed armed police and an ambulance near the scene.

Police later said on Twitter that the attacker had been "neutralized" and taken to hospital.

🔴 Parvis de #NotreDame Situation maîtrisée, un policier blessé, l'auteur des faits a été neutralisé et orienté vers un hôpital — Préfecture de police (@prefpolice) June 6, 2017

Visitors inside the cathedral at the time of the incident were not allowed to leave.

Policiers d'intervention avec bouclier rangent leur matériel #NotreDamepic.twitter.com/XzJlA4s1kV — Jonathan Moadab (@Jonathan_RTfr) June 6, 2017

Karine Dalle, a spokeswoman for the Paris diocese, told BFM TV that 900 people were inside the cathedral as police secured the area.

Nancy Soderberg, a former US ambassador to the United Nations, was among those inside the cathedral.

She told AP that she had been admiring the building's stained glass windows when she heard an announcement in French urging visitors to stay calm as police dealt with an incident outside.

Soderberg said people inside the cathedral became nervous when they were told the doors were closing and that everyone would be forced to stay inside.

The former ambassador said the group managed to stay calm and orderly, despite not knowing what was happening.

However, she said "everyone was very quiet and very scared" when police came in to check the cathedral's pews row by row.

Soderberg tweeted a photo from inside the cathedral, showing visitors putting their hands in the air as instructed by police.

Locked inside #notre dame cathedral in #paris while police investigate attack outside against a policeman. All calm pic.twitter.com/Z4B8wUzPTV — Nancy Soderberg (@nancysoderberg) June 6, 2017

French counterterrorism authorities have opened an investigation into the incident, according to the French Prosecutor’s Office.

Notre Dame Cathedral is one of the most popular tourist sites in Paris, attracting an estimated 13.6 million visitors a year.

De evakuerer Notre-Dame. Det går rykter om skyting og at en mann er skutt. Nå sperrer politiet av gatene. #parispic.twitter.com/NtKKLzE4gX — Linn Gjerstad (@LinnGjerstad) June 6, 2017

France has been under a state of emergency since November 2015, when terrorist attacks left 130 people dead in Paris.