Police responded, traded fire with the shooter and killed him, the authorities said.
"The victims remain in the same condition, two women are seriously injured, and they are in intensive care", Kazanfar Kurbanov, the chief doctor at the Dagestani emergency medicine center, told TASS. The assailant was identified only as a 22-year-old man from the region, the Russian news agency Tass said.
Police have not commented on the possible motive for the attack.
It is often the scene of attacks, some claimed by the Islamic State jihadist group.
Biggest Earthquake In The UK In 10 Years
The tremor - with a magnitude of 4-point-4 - struck around 20 kilometres north of Swansea just after two-thirty this afternoon. Twitter users reacted to the "earth moving" event. "My desk was moving independently of itself and there was a low rumble".
The Russian Orthodox Church issued a statement that said its leader, Patriarch Kirill, believes the attack was meant to foment tension between Christians and Muslims.
The regional internal affairs ministry said in a statement that the assailant used a hunting rifle, and that four women were killed on the spot, while the attacker was "eliminated".
"We had finished the mass and were beginning to leave the church".
"He was carrying a rifle and a knife", he added.
Dagestan, a predominantly Muslim province on the western shore of the Caspian Sea, has become the epicenter of an Islamic insurgency following two separatist wars in neighboring Chechnya.
ISIS claimed responsibility Monday for the deadly attack on Orthodox churchgoers in Russian Federation that left at least five women dead.