When eight members of the same family were found shot to death in rural Ohio in 2016, the massacre stunned and frightened the community, and investigators wondered at first whether the gunman could be among the dead.

When the authorities later announced that marijuana operations were found near the crime scene, it raised the possibility that the slayings could be drug-related.

On Tuesday, after more than two years of speculation about why the family was executed at night, as most of the victims slept, law enforcement officials announced arrests in the case, which Mike DeWine, the Ohio attorney general, described as “a thousand-piece puzzle.”

A husband, wife and their two adult sons were charged with aggravated murder and could face the death penalty if convicted; the couple’s mothers were accused of participating in a cover-up. The authorities said the suspects had been friends with the family that was killed.