MANILA — In an impoverished area near Manila, the Philippine capital, the body of Allan Rafael lay in a white coffin as distraught relatives reminisced about the cancer-stricken man who died in detention after being arrested in President Rodrigo Duterte’s brutal drug war.

On top of the coffin were photographs of Mr. Rafael, a former overseas Filipino worker, taken when he was still employed as a cook in the Middle East, and one donated by activists, with the words: “Justice for Allan, Stop the Killings.”

When the police arrested him on Aug. 2, Mr. Rafael, 35, who had lymphoma, tried to explain why he looked emaciated. It wasn’t because of narcotics. He was just really sick, having undergone chemotherapy since his return from Saudi Arabia last year for treatment.

But his reasoning fell on deaf ears, and he was detained, beaten and tortured by the police to obtain a confession, according to his younger brother, Aarun Rafael, who had visited him in jail.