The group, who were armed with assault rifles, broke into the homes and ruthlessly killed their victims – including a child.
Police in San Miguel, El Salvador fear that the massacre could be gang related.
Officials added that the culprits could be members of Mara Salvatrucha – which is notorious for violence and merciless killings.
It is thought that gangsters often disguise themselves in military and police uniforms when they carry out killings.
El Salvador's murder rate surged 70 percent in 2015 to one of the highest in the world because of increasing battles between rival gangs and security forces.
Separately, five suspected gang members died in a highway shootout with police after opening fire with revolvers and shotguns.
They were stopped in a taxi at a highway checkpoint in the southwestern municipality of Olocuilta, Express reported.
E/S1