A man armed with a hammer shouted "this is for Syria" and wounded a policeman before being shot and wounded by other officers on Tuesday (local time) outside Notre Dame Cathedral in Paris, one of France's most famous tourist sites.
The Paris prosecutor's office swiftly launched a counter-terrorism investigation into the attack, the first since President Emmanuel Macron won power last month and days before the first round of a parliamentary election in France.
Interior Minister Gerard Collomb said the attacker was carrying the identification card of an Algerian student and that preliminary information indicated he had acted alone.
Dozens of armed police sealed off the area and put the Gothic cathedral into lockdown with nearly 1,000 tourists and worshippers inside.
The incident came three days after militants drove a van at high speed into pedestrians in London before stabbing revellers on the street and in nearby bars, killing seven people and wounding dozens. That followed a suicide bombing in the northern English city of Manchester that killed 22 people.
"This happens nearly every week now. I just hope it has nothing to do with the election," David Stoklo, an American visitor to Paris, told Reuters TV.
Tuesday's attack will put a renewed focus on France and Europe's struggle to deal with unsophisticated, low-tech attacks in the countdown to the first round of the parliamentary election on Sunday. A second round will be held on June 18.
Macron's rivals portrayed him as weak on security during the presidential election campaign. Collomb said fighting terrorism was the president's "number one" priority.
It was too early to tell if the attack would have any impact on the outcome of the two-round parliamentary election. A poll published earlier on Tuesday showed Macron's new Republic on the Move party heading for a landslide win.