TOKYO — Over the summer, the man told his father that his life had no meaning. Then he went looking for others who felt the same way, and apparently killed them.

The man, Takahiro Shiraishi, was arrested on Tuesday, a day after the police visited his apartment almost 30 miles southwest of Tokyo and found the dismembered parts of nine bodies. Japan was riveted as the news media disclosed more grisly details from the second day of the investigation, reporting that Mr. Shiraishi, 27, had confessed to finding the victims, who he said were considering suicide, on Twitter.

In Japan, a low-crime country, it is the grimmest such case since a former employee of a center for the disabled went on a knife rampage there, killing 19 people last year.

Mr. Shiraishi’s case, involving social media suicide pacts, connections to Tokyo’s notorious red-light district and neighbors who did not report a noxious smell coming from the suspect’s apartment for months, has the hallmarks of a grotesque thriller novel or horror movie.