NEW YORK (Reuters) - Four homeless people were killed after a man attacked them while they slept and beat them to death, police in New York City said.

A 24-year-old suspect, also a homeless, was detained, police said at a news conference, adding that another displaced person survived the attacks but was seriously wounded and taken to hospital in critical condition.

Police received a report of the killing through an emergency call before 2 am on Saturday.

The other victim was the seriously injured man, who was wounded in the head and police hope to question him as part of the ongoing investigation.

Police chief Steven Hughes said that during the search, police also found the suspect, who meets the specifications made by witnesses, along with a metal object he described as a tube.

"It seems that all the victims were asleep when they were attacked," chief investigator Michael Baldasano said. "It appears to be just random attacks.