More than 15 police officers and four civilians, including an Orthodox priest, have been killed by armed militants in Russia's southern republic of Dagestan, its governor Sergei Melikov said in a video statement.
The gunmen opened fire on two Orthodox churches, a synagogue and a police post in two cities on Sunday, according to the authorities.
Russia's National Anti-Terrorist Committee described the attacks in the predominantly Muslim region with a history of armed insurgency as terrorist acts.
Monday, Tuesday and Wednesday were declared days of mourning in the region.
Dagestan's Interior Ministry said a group of armed men shot at a synagogue and a church in the city of Derbent on the Caspian Sea. Both the church and the synagogue caught fire, according to state media.
Almost simultaneously, reports appeared about an attack on a church and a traffic police post in the Dagestan capital, Makhachkala.
Authorities announced a counter-terrorist operation in the region, although there was confusion about how many militants were involved in the attacks.
The Anti-Terrorist Committee said five gunmen were "eliminated". The governor said six "bandits" had been "liquidated".
There was no immediate claim of responsibility for the attacks as the authorities launched a criminal investigation on the charge of a terrorist act.
Russian state news agency Tass cited law enforcement sources as saying a Dagestani official was detained over his sons' involvement in the attacks.
Mr Melikov said in the video statement on Monday that the situation in the region was under control of the law enforcement and local authorities. He vowed that the investigation will continue until "all the sleeping cells" of the militants are uncovered.
He claimed, without providing evidence, that the attacks might have been prepared from abroad and referenced what the Kremlin calls "the special military operation" in Ukraine in an apparent attempt to link the attacks.
In March, gunmen opened fire on a crowd at a concert hall in suburban Moscow, killing 145 people.
An affiliate of the Islamic State group claimed responsibility for the attack, but Russian officials also sought to link Ukraine to the attack without providing any evidence. Kyiv has vehemently denied any involvement.