A homeless ex-convict was charged with attempted murder and unlawful imprisonment after police say a man was found buried under junk including a toilet in a basement where a decomposing female body was also discovered.

Schenectady police charged 44-year-old Harold Ortiz Wednesday night. Ortiz was arraigned Thursday morning and ordered held without bail. It could not immediately be determined whether he has a lawyer who could comment on the charges.

Police say Ortiz struck a man with a shovel and buried him under several feet of junk, including a tire and boxes, in a five-unit apartment house's cellar.

Officers were called to the house to check on the welfare of a resident. An odor led them downstairs, where they found the barely coherent man and the dead woman. Ortiz has not been charged in relation to the woman's death.

Police didn't say whether the victims were related. An autopsy was scheduled Thursday to determine the woman's identity and how she died.

Ortiz was released from state prison on July 10 after serving 17 years for an attempted murder in Brooklyn, according to state records.