PARIS — A police officer shot and wounded an assailant armed with a hammer and kitchen knives on the square outside Notre-Dame Cathedral in Paris on Tuesday afternoon, according to the authorities.

The cathedral, a Gothic landmark on the Île de la Cité in the Seine, across from the headquarters of the Paris police prefecture, was sealed off, and about 900 visitors and worshipers were told not to leave until the situation was declared safe. The square was evacuated.

Gérard Collomb, the French interior minister, told reporters that the attack occurred around 4:20 p.m. when the man approached three police officers from behind and started hitting one of them with a hammer.

“This is for Syria,” the assailant yelled. At least one officer opened fire, injuring the attacker, who was hospitalized.