The source said one policeman was killed and three wounded in an initial shootout and that another four were killed when additional troops sent to combat the militants came under attack.
"At about 14:00 Moscow time (10:00 GMT) a column of riot police was hit by an explosion, and unknown attackers then opened fire at it from a nearby wood. As a result of the attack, four servicemen died at the scene, while six sustained serious injuries and were taken to a local hospital," the source said.
He also said an operation had been launched to find the gunmen.
The incident took place some 30 km (19 miles) southwest of Makhachkala.
Militant attacks are common in Russia's North Caucasus republics. Neighboring Ingushetia has seen a marked rise in militant activity of late.
Add to blog
You may place this material on your blog by copying the link.
Image Galleries: Yury Gagarin: A down-to-earth person
Infographics: The Linguistic Diversity of the Planet
During Vladimir Putin’s annual Q&A session some members of the Valdai International Discussion Club asked him several questions. How united is the West in its desire to punish Russia? Which EU countries are in favour of isolating Russia? Is this even possible? And what is going on in Ukraine?