Prosecutors formally charged Mr. DiNardo, who knew the victims, with all four murders and Mr. Kratz with three of them, and both men face a host of related charges.
On Thursday, a lawyer for Mr. DiNardo said his client confessed in an agreement that would spare him the death penalty.
Officials said the murders sprang from three separate deals to sell the victims between a few ounces and four pounds of marijuana last week. But they had no explanation for the larger question of why relatively small-time drug transactions would set off a killing spree.
âIâm not really sure if we could ever answer that question,â Matthew D. Weintraub, the Bucks County district attorney, said at a news conference.
The arrest of Mr. Kratz, who has a history of burglary, theft and related arrests, widened the scope of an already sprawling case, one that has transfixed the Philadelphia region, with frequent live TV updates and helicopters hovering over the farm in affluent Solebury Township while authorities dug with cadaver-sniffing dogs.
Mr. Weintraub said that excavations on the farm, which is owned by Mr. DiNardoâs parents, had yielded four bodies positively identified as the missing men: Jimi Taro Patrick, 19; Dean Finocchiaro, 19; Thomas Meo, 21; and Mark Sturgis, 22.
Mr. DiNardo has been described by prosecutors, his own lawyers and the police as mentally ill â last summer, he was sent involuntarily to a mental hospital â and another young man who socialized with him and two of the victims said Mr. DiNardo had talked about killing people and having people killed.
Mr. DiNardo lived 30 miles south of the farm with his parents in a four-bedroom stucco house with a pool in Bensalem. The close-in Philadelphia suburb is overlaid with strip malls, and where an American-born population mixes with immigrant strivers from Asia and the Middle East.
Mr. DiNardoâs grandfather, for whom he was named, acquired numerous properties in Philadelphia and in Bucks County, including storefronts and an apartment house. Before his death, he worked with his son, Antonio DiNardo, to build homes on Wayland Circle in Bensalem, a cul-de-sac where the family still lives. A neighbor said that, as a teenager, Cosmo DiNardo would volunteer to cut lawns and shovel snow. âCosmo has been a baby to us,â said the neighbor, a physician who asked to be identified by only his first name, Abid, to protect his privacy.
But Mr. DiNardo was no baby to Bensalem police, whose chief, Frederick Harran, said the department had 30 contacts with him since 2011.
Only one of those contacts had led to an arrest: In February, officers responding to reports of gunfire found Mr. DiNardo in a car with a 20-gauge shotgun. He had been prohibited from possessing a firearm because of his prior hospital commitment.
Mr. DiNardo graduated in 2015 from Holy Ghost Prep, a private Catholic high school in Bensalem, and attended Arcadia University in Glenside, Pa., for one semester. According to the Philadelphia Inquirer, Mr. DiNardo was barred from returning to the school after making disturbing remarks.
The complaints filed against the two men stated that Mr. Kratz admitted he intended to rob some of the victims, and to being present for three of the killings â but not to taking part in any of them.
Mr. DiNardo told investigators that on July 5, he agreed to sell Mr. Patrick, who was a year behind him at Holy Ghost Prep, four pounds of marijuana for $8,000. Mr. Patrick, the only one of either the victims or the accused enrolled in college, had just finished his freshman year at Loyola University in Baltimore.
Mr. DiNardo drove his former schoolmate to the farm in Bucks County, not far from the art colony and quaint tourist destination of New Hope.
There, the complaints said, Mr. Patrick admitted that he had only $800, and Mr. DiNardo offered to sell him a shotgun instead.
Instead of going through with the gun sale, Mr. DiNardo shot and killed Mr. Patrick with a .22-caliber rifle, the complaints said. He then drove a backhoe to the site, dug a hole and buried the body.
The location was so remote, the district attorney said, that if Mr. DiNardo had not told police exactly where the body was, âI donât know if we would ever have found it.â
On July 7, two days later, both suspects told investigators, they drove to Mr. Finocchiaroâs home in Middletown, ostensibly to sell him four ounces of marijuana, but decided on the way to rob him instead. Mr. DiNardo said he had taken a Smith & Wesson .357 Magnum handgun that belonged to his mother.
Each suspect claimed that, after driving him to the Solebury site, the other one shot Mr. Finocchiaro in a barn.
Mr. DiNardo wrapped the body in a blue tarp and used the backhoe to put it into a metal tank he called âthe pig roaster,â which Mr. Weintraub, the district attorney, described as âan old oil tank that had been converted into a cooker.â
Both suspects said Mr. DiNardo had arranged another meeting that night to sell marijuana to Mr. Meo, who showed up with his friend, Mr. Sturgis. The young men were childhood friends who worked for a construction company owned by Mr. Sturgisâs father. They drove with Mr. DiNardo in his silver 2016 Ford pickup truck to the farm, where Mr. Kratz was waiting.
âWhen they turn their backs on me, I shot Tom in the backâ with the Smith & Wesson, the complaints quoted Mr. DiNardo as saying. Both suspects recalled Mr. Meo falling to the ground, screaming, while Mr. Sturgis ran and Mr. DiNardo shooting him as he fled.
The complaints said that Mr. DiNardo ran out of ammunition and, to make sure Mr. Meo was dead, he drove over him with the backhoe.
Mr. DiNardo used the backhoe to put both bodies into the same tank that held Mr. Finocchiaroâs body, poured gasoline on them, and lit it.
âThere was an attempt to burn the bodies, to deface them, to obliterate them, but I donât believe it was successful,â Mr. Weintraub said.
Both suspects said that they returned to the farm the next day, according to the complaints. Mr. DiNardo used the backhoe to dig a hole and then put the three partly burned bodies into it. That day, Mr. DiNardo gave two guns, the Smith & Wesson and an Intratec 9-millimeter pistol, to Mr. Kratz, who later told investigators where to find them.
It was that same day that investigators began to focus on the farm, after detecting a signal there from Mr. Finocchiaroâs cellphone.
Before this arrest, Mr. Kratz, who lives in Ambler, in neighboring Montgomery County, faced criminal charges three times in eight months. Two of those cases, both in Philadelphia, are still pending: He was arrested in June 2016, and again this past February, and each time he was charged with burglary, theft, receiving stolen property, and related charges.