(CNN) An Ohio family carefully studied the habits of members of another family -- their routines, the layouts of their homes and where they slept -- as they planned a deadly massacre that stunned a rural town, a prosecutor said Tuesday.

The eight victims -- who ranged in age from 16 to 44 -- were found shot to death at four crime scenes in and around the small town of Piketon on April 22, 2016. At one scene, police found a 4-day-old baby next to his slain mother. That child, along with a 6-month-old and a 3-year-old, survived.

The suspects "spent months planning the crime," Ohio Attorney General Mike DeWine said. But they made mistakes, DeWine said.

More than two years later, authorities arrested four members of the Wagner family Tuesday in connection with killing the members of the Rhoden family. Two grandmothers of the Wagner family were also charged in an alleged cover-up of the crime, DeWine said.

He declined to identify a motive but said custody of a child "plays a role in this case."

Read More