Police confirmed to AFP they had arrested 27-year-old Takahiro Shiraishi, who lives in the apartment in Zama, south of Tokyo.
According to public broadcaster NHK, Shiraishi told police: "I killed them and did some work on the bodies in order to hide the evidence."
Jiji Press said Shiraishi had told police that he chopped up the bodies in a bathroom and a saw was found in his room.
The bodies were of eight women and one man, several media reported.
More From This Section
According to Jiji Press, police found the two heads inside a cool box at the entrance of the apartment before making the grisly discovery of the other bodies.
Police found the other bodies in a number of large boxes in the apartment, reports said.
Authorities had been investigating the disappearance of a 23-year-old woman and discovered a connection between her and Shiraishi.
This woman had earlier tweeted "I'm looking for someone to die with me," according to the Sankei Shimbun daily.
Other media said Shiraishi and the woman had connected via a website featuring information about suicides.
CCTV captured Shiraishi and the 23-year-old woman walking together last Monday.
She had been missing since September 21 and her older brother called in her disappearance to police on Tuesday, the Asahi Shimbun reported.