After a police officer fatally shot an 18-year-old man in his Bronx apartment on Thursday, the man’s grandmother, a witness to the shooting, was taken into custody and held against her will for several hours, a friend of the family said on Saturday.

The officer confronted the man, Ramarley Graham, who was in the bathroom, possibly trying to flush marijuana down the toilet. A moment later, a shot rang out, killing the teenager.

While narcotics officers had followed Mr. Graham to the apartment on East 229th Street in Wakefield thinking he was armed, no gun was found, making the grandmother, Patricia Hartley, 58, a crucial witness. The shooting seems to be drawing the sort of close scrutiny that attended the killing of Sean Bell, who died in a hail of 50 police bullets in Queens in November 2006.

Little is known of precisely what Ms. Hartley saw and what of that she has told detectives. But her treatment by the police in the hours after her grandson was killed could become a sticking point in the investigation.