A courtroom will be closed to the public when a undercover New York City detective testifies in a gang murder and drug case, to protect both the detective and the integrity of undercover operations, a judge has ruled.

Southern District Judge Paul Engelmayer (See Profile), over the objection of defendants Carlos Urena and Limet Vasquez, issued a mid-trial order and opinion Monday saying all but the defendants’ family members will be kept out of the courtroom.