Attacks on police posts, churches and a synagogue in Russia's North Caucasus republic of Dagestan have left more that 15 police officers and several civilians dead. Six gunmen were also killed.
The apparently coordinated attacks targeted the cities of Derbent and Makhachkala on the Orthodox festival of Pentecost.
The assailants have not been identified, but Dagestan has in the past been the scene of Islamist attacks.
The republic's head, Sergei Melikov, said it was understood who was behind the organisation of the attacks, without giving details.
Two churches and a synagogue were targeted in Sunday's attacks, as well as a police post in Makhachkala, Dagestan's largest city. An Orthodox Church priest was among those killed.
The figure of more than 15 police officers killed was given by Mr Melikov. He also said several civilians had lost their life, including a priest, Father Nikolai Kotelnikov, who he said had served in Derbent for more than 40 years.
Mr Melikov announced that three days of mourning would begin on Monday.
The gunmen have not yet been identified, but in a video on Telegram, Mr Melikov said their attack had been prepared abroad and that Dagestan was now directly involved in Russia's war in Ukraine.
"We understand who is behind the organisation of the terrorist attacks and what goal they pursued," he said.
A leading Russian nationalist in occupied Ukraine, Dmitry Rogozin, warned that if every attack was blamed on "the machinations of Ukraine and Nato, this pink mist will lead us to big problems".
Footage posted on social media shows people wearing dark clothes shooting at police cars, before a convoy of emergency service vehicles arrive at the scene.
In Derbent - home to an ancient Jewish community - gunmen attacked a synagogue and a church, which were then set on fire.
A police vehicle was also reportedly attacked in the village of Sergokal. Police detained Magomed Omarov, head of the Sergokalinsky district near Makhachkala, following reports that two of his sons were among those who carried out Sunday's attacks.
Russian news agencies reported on Monday morning that the counter-terrorism operation launched after the attacks had now come to an end.
Dagestan, one of the poorest parts of Russia, is a predominantly Muslim republic.
Between 2007 and 2017, a jihadist organisation called the Caucasus Emirate, and later the Islamic Emirate of the Caucasus, staged attacks in Dagestan and the neighbouring Russian republics of Chechnya, Ingushetia and Kabardino-Balkaria.
Following an attack on the Crocus City Hall venue near Moscow in March, authorities pointed the finger of blame at Ukraine and the West, even though the Islamic State group claimed it.
Back then President Vladimir Putin had insisted that "Russia cannot be the target of terrorist attacks by Islamic fundamentalists” because it “demonstrates a unique example of interfaith harmony and inter-religious and inter-ethnic unity”.
And yet three months ago Russia’s domestic security service, the FSB, reported that it had thwarted an IS plot to attack a Moscow synagogue.
Since Russia’s full-scale invasion of Ukraine, Russians have been led to believe that their principal adversaries are Ukraine and the "collective West". That’s a message Russian authorities are reluctant to change, to avoid sparking public doubts about the official narrative.
Source: BBC