Authorities in Russia have identified the suspected gunman who killed five people before being shot dead by security forces at an Orthodox church in the predominantly Muslim North Caucasus republic of Daghestan.

The mayor’s office on February 19 in the town of Kizlyar identified the gunman responsible for the attack as Khalil Khalilov, 22, from the Tarum district of Daghestan.

Officials said four other people were wounded in the February 18 incident at a local Russian Orthodox church, at least one of them seriously.

All of the killed were reportedly women. Three of the injured were Russian National Guard troops.

The Islamic State (IS) terrorist group claimed responsibility for the attack in a statement issued by the group's Amaq information agency. The statement provided no evidence to support the claim.

Police said the gunman opened fire with a hunting rifle on people attending a Maslenitsa celebration near a local church. Maslenitsa is a Christian festival marking the last days before the season of Lent.

"The patriarch considers this heinous crime on the Great Lent eve as a provocation aimed at sparking hostilities against Orthodox believers and Muslims who have been living side by side in peace in the Caucasus for centuries."

An unnamed law enforcement source was earlier quoted by the state-run TASS news agency as saying the gunman was a 22-year-old local man suspected of having ties to "extremist" organizations.

Other reports said the shooter was accompanied by a woman, who fled the scene.

The RBK website quoted a local priest as saying the attacker opened fire as worshippers were leaving an afternoon service.

"We had finished the mass and were beginning to leave the church," Father Pavel was quoted as saying. "A bearded man ran toward the church shouting 'Allahu Akbar' [God is great] and killed the people."

The Investigative Committee has opened a probe into the shooting.

Kizlyar lies 170 kilometers from Daghestan's capital city, Makhachkala, and has a population of some 50,000 people. Ethnic Russians make up about 40 percent of the population, officials said.