Seven soldiers were wounded.
Bloodstained bodies lay in the street on the outskirts of Makhachkala, and ambulances quickly whisked away the wounded. It was not immediately known whether there were any civilian victims of the blast.
Rashid Isayev, the head of the province's criminal police, said the explosion occurred as three trucks packed with Interior Ministry troops arrived at a bath house in Makhachkala. He would not immediately comment on what type of explosive device was used.
Dagestan, which borders the warring republic of Chechnya, has been plagued by rising violence believed connected with insurgents and criminal gangs.
Since Jan. 1, explosions have killed about 30 police and security officers and wounded scores more. Some blame the killings on Islamic militants working with Chechen rebels, while others say the violence could be rooted in rivalries between the region's more than 100 ethnic groups