Five women were killed and several others were injured after a gunman opened fire with a hunting rifle on people leaving a church service in Russia's Dagestan region on Sunday, Russian media outlets reported.

The shooting unfolded outside a church in Kizlyar, a town of about 50,000 people on the border with Chechnya. The Russian news agency TASS cited Svetlana Petrenko of the Investigative Committee of the Russian Federation as the source for the number of people killed and wounded.

The Islamic State terror network claimed responsibility, according to its Amaq media agency. ISIS said the killer was a "soldier of the caliphate," a man known as Khalil al-Dagestani, The New York Times reported.

The gunman was shot dead by police responding to the scene, a law enforcement source told the Interfax news agency. According to Interfax, the gunman has been identified as a local man in his early 20s.

"People were leaving a church after an evening service when he opened gunfire at them," Shuvalov told TASS. Two police officers and a woman were among the wounded, according to Shuvalov. One woman later died at a hospital, a law enforcement source told RIA Novosti.

A witness posted a video of the shooting on Twitter, which captured the moment shots were being fired.

Russian television station REN-TV posted surveillance video showing the gunman walking with the gun along main streets of the city.

Russian news outlets also posted photos on social media of the alleged weapon used in the attack, in addition to a body in front of the church covered by a tarp.

Parishioners were at the church celebrating the end of the Russian festival of Maslenitsa, a holiday which marks the start of Lent for Russian Orthodox Christians, according to RT.

POLICE SHOOT MAN DURING SWORD ATTACK ON INDONESIAN CHURCH

A witness to the shooting, Oksana, told RT the gunman targeted people as they were leaving the church, but many took cover inside the building.

“There were a lot of people there, moms with little children, elderly people. I believe God saved us, not allowing the man to get inside the church,” the woman told the news outlet.

Authorities have not yet disclosed what motivated the shooting, but the shooting took place in the region where Moscow has led two wars against separatists and radical religious groups since the 1991 Soviet collapse. The region has also seen a large number of people join ISIS, according to Reuters.

Dagestan is a predominantly Muslim region between Chechnya and the Caspian Sea. Following two separatist wars in neighboring Chechnya, an Islamist insurgency spread to Dagestan.

The Associated Press contributed to this report.