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.
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.
Visitors inside the cathedral at the time of the incident were not allowed to leave.
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.
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.
France has been under a state of emergency since November 2015, when terrorist attacks left 130 people dead in Paris.