An 84-year-old priest was killed and four other people taken hostage by two armed men who stormed his church in a suburb of Rouen in northern France.
The two attackers, who said they were from the so-called Islamic State (IS), slit Fr Jacques Hamel’s throat during a morning Mass, officials say.
Police later surrounded the church, in St-Etienne-du-Rouvray, and shot dead both hostage-takers.
One of the hostages is in a critical condition in hospital.
President Francois Hollande, visiting the scene, said the attackers had committed a “cowardly assassination” and France would fight IS “by all means”.
Pope Francis decried the “pain and horror of this absurd violence”.
UK Prime Minister Theresa May branded the attack “sickening” and offered her condolences to the people of France.
One attacker is reported to have been known to French police, and had tried to enter Syria last year.
Police special forces raided a house in Saint-Etienne-du-Rovray in the aftermath of the attack, and French prosecutors earlier said one person had been arrested.
The attack happened during morning Mass at the historic church, situated in a quiet square of St-Etienne-du-Rouvray.
A nun, who identified herself as Sister Danielle, said she was in the church at the time.
“They forced [Fr Hamel] to his knees. He wanted to defend himself, and that’s when the tragedy happened,” she told French media.
“They recorded themselves. They did a sort of sermon around the altar, in Arabic. It’s a horror”.
She said she managed to flee as they were preparing to kill him.
Elite police units, specialised in hostage-taking, surrounded the church.
President Hollande said the attackers claimed to be from the self-styled IS before they were killed by police as they came out of the church.
Three of the hostages were freed unharmed, but one remains in a critical condition, said French interior ministry spokesman Pierre-Henri Brandet.
‘We will not be afraid’: Adam Fleming reports from the scene
This quiet suburb, a few miles from the cathedral city of Rouen, is quieter than usual after this morning’s horrific events. The heavily armed police have set up a large cordon around the church; a row of white tents – presumably for forensics officers – obscures the view. The nearby supermarket is closed and its car park is being used by journalists rather than shoppers.
Locals seem shocked, but not in a dramatic way. A man told me how he had conducted christenings, marriages and funerals for years alongside Father Hamel. He showed me a set of keys – keys for the church. “When I heard the news of his death, it was like being hit on the head from above. I just want to go to the church but I can’t,” he said.
A priest from a neighbouring parish, who also knew Fr Hamel, passed through on his way to conduct his own mass. His message tonight will be that this is not an attack on the Catholic Church – it is merely the latest symbol of French life to be targeted.
And the mood of some here was summed up by a woman cycling past the waiting media, who shouted to no-one in particular: “We will not be afraid.”
Within hours of the attack, the IS-linked Amaq news agency, said “two IS soldiers” had carried out the attack.
Few details are yet known about the attackers, but Mohammed Karabila, a local Muslim leader, told the Associated Press that one of them had been “followed by police for at least a year and a half”.
The French ITele website also said one had tried to reach Syria in May 2015 but was turned back at the Turkish border.
According to the report, he then spent nearly a year in prison before being released in March, on condition he wear an electronic tag and move back in with his parents.
Residents of St-Etienne-du-Rouvray reacted with shock and sadness to the killing of Fr Hamel, a well known figure in the community.
“My family has lived here for 35 years and we have always known him,” said Eulalie Garcia.
“He was someone who was treasured by the community. He was very discreet and didn’t like to draw attention to himself.”
Pensioner Claude-Albert Seguin told AP: “Everyone knew him very well. He was very loved in the community and a kind man.”
French Prime Minister Manuel Valls has expressed his horror at the “barbaric attack” and said: “The whole of France and all Catholics are wounded. We will stand together.”
The Archbishop of Rouen, Dominique Lebrun, who was attending a Catholic gathering in Poland, said: “I cry out to God with all men of goodwill. I would invite non-believers to join in the cry.
“The Catholic Church cannot take weapons other than those of prayer and brotherhood among men.”
France is still reeling from the Bastille Day attack in Nice earlier this month, when a lorry was driven into celebrating crowds by Tunisian Mohamed Lahouaiej-Bouhlel, killing more than 80 people.