MAKHACHKALA, Russia -- A gunman opened fire with a hunting rifle on churchgoers leaving a service in Russia's Dagestan region, killing five people and wounding four others, then was shot and killed by police, authorities say.

The shootings took place Sunday evening in Kizlyar, a town of about 50,000 people on the border with Chechnya.

Four people died at the scene and a fifth died at a hospital, regional Interior Ministry spokesman Ruslan Gadzhiibragimov said. The gunman was a local resident, and his wife has been detained for questioning, he said.

The motive for the attack was not immediately known.

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