Five women have been killed in a shooting at a church in Russia's volatile republic of Dagestan.
Five others, including a police officer and a national guardsman, were injured, Russian officials said. Two are said to be in a critical condition.
A man fired at people leaving an evening service in the city of Kizlyar.
The attacker was shot and killed at the scene. He was later identified as 22-year-old Khalil Khalilov, a resident of Dagestan.
The Islamic State (IS) group said it was behind the attack but did not immediately provide any evidence.
The gunman used a hunting rifle, opening fire on worshippers leaving a service during celebrations for Maslenitsa - a traditional pre-Lent festival, Russian media report.
Four women were killed at the scene, and another woman died later in a hospital.
One of them was an award-winning doctor, Lyudmila Shcherbakova, who had more than 40 years' experience working in Dagestan's hospitals, Tass news agency reports.
Russian news outlet RBK quoted an Orthodox Christian priest as saying the attack took place immediately following the afternoon service.
"We had finished the mass and were beginning to leave the church. A bearded man ran towards the church shouting 'Allahu Akbar' (God is greatest) and killed four people," the priest said.
"He was carrying a rifle and a knife," he added.
IS later said - through its information wing Amaq - that one of its "soldiers" had carried out the attack.
However, it provided no evidence to back up its claims.
The Dagestan Muftiate - the administrative body for Sunni Muslims in the region - expressed sorrow over the attack and condemned the gunman as a "Wahhabi... one of those who espouse pseudo-Islam, which has no connection to true Islam".
Wahhabism is an ultra-conservative form of Sunni Islam followed by Saudi Arabia's ruling family and religious establishment.
IS made the claim in the name of its so-called "Caucasus Province", the last official branch set up by the group in 2015.
The branch has claimed a number of deadly attacks against security personnel in Dagestan.
Dagestan, located in Russia's North Caucasus, is an ethnically diverse and largely Muslim federal republic.
The Moscow Patriarchate of the Russian Orthodox Church called the shooting a "monstrous crime" aimed at sowing discord between Christians and Muslims in Dagestan.