A man overdosed on heroin and was severely wounded in an apparent hammer attack early Wednesday in a San Francisco motel room, police said.

The assault happened around 4 a.m. at a Travelodge on Market Street near Valencia Street. Two men and a woman were inside a room when one of the men overdosed. He also sustained major injuries when he was beaten by a hammer, according to police.

The victim is in critical condition at an area hospital.

The other man in the room was also taken to a hospital with unknown injuries. Footage from the scene shows him being led away from the motel in handcuffs and a neck brace.

The woman too was hurt, but her condition remains unclear.

Police have not confirmed whether the second man and woman are in custody.

No further details were immediately available.