The authorities said they had no leads about how the attack was executed or who was responsible. The Islamic State media outlet Amaq released a statement on Wednesday claiming responsibility for the attack.
All the victims were members of the Albu Faraj tribe, known for its staunch opposition to Sunni extremists in the area, a notorious safe haven for suicide bombers and terrorists seeking to infiltrate the capital. Several prominent members of the tribe work for a local Sunni militia that is part of Iraq’s popular mobilization forces, created in 2014 to help defend Iraq against the Islamic State.
Witnesses said the militants, all of whom were masked and wearing army uniforms, sneaked into the village after Tuesday evening prayers, apparently by fording a nearby river. They walked down a dirt road to the home of a local lawyer, Rahim Marzouk, who was known for his work on behalf of victims of the Islamic State.
When Mr. Marzouk answered the door, the gunmen opened fire, killing him, his wife, his teenage son and his 5-year-old daughter, said a neighbor, Khaled al-Salah, who rushed to the street when he heard the gunfire just a few feet from his home.
Mr. Salah and his son ran toward the victims, intending to try to get them medical attention. But gunmen, some perched on nearby rooftops, opened fire on them and other neighbors who were running to the scene.