They arrived carrying guns. As they opened fire, people on the sidewalk started running.

In the attackers’ van the authorities found the manifesto-style note, officials said. It was brief and “rambling” and did not offer a clear motive for the rampage. But in nearly illegible handwriting the note indicated that Mr. Anderson believed he was carrying out “God’s will,’’ the officials said.

It was not the only alarming item discovered in the van. Investigators also found a live pipe bomb, said the New Jersey attorney general, Gurbir S. Grewal. The special agent in charge of the F.B.I.’s office in Newark, Gregory W. Ehrie, said the device was “not complicated” but was “sophisticated in that time and effort went into creating it.”

Mr. Grewal said the police did not know about the shooting at the cemetery when Mr. Anderson and Ms. Graham blasted their way into the market. He said the assailants arrived there at 12:21 p.m. on Tuesday. The police did not learn that Detective Seals had been killed until 17 minutes later, when someone discovered his body at the cemetery and called 911.

Detective Seals, a father of five, joined the force in 2006. He was credited with helping to prevent a sexual assault in 2008, when he and his partner climbed a fire escape while going after a 23-year-old man who had been chased away by a woman in the building minutes earlier, and had returned.

In contrast to the encounter with Detective Seals at the cemetery, which did not last long, the gun battle in the market continued for more than three hours, according to Mr. Grewal. It ended at 3:47 p.m., 22 minutes after the armored vehicle smashed into the market, when officers found the bodies inside.