Seventeen celebrated monkeys that have the subjects of a protracted dispute between local animal advocates and a research organization were returned last night to the Silver Spring laboratory from which they were seized last month.

Their return had been ordered Friday by a Montgomery County judge, but in this latest chapter in the tangled animal tale, people caring for the monkeys in a Rockville home first barricaded the door and refused to turn them over when representatives of the Institute for Behavioural Research arrived at about 4 p.m.

The animal welfare advocates allowed the monkeys to be taken away only after frantic efforts to delay the effect of the judge's ruling failed.

Montgomery County Circuit Court Judge David L. Cahoon, in a session in his chambers late Friday, ordered the temporary return of the monkeys to the institute, where police have charged they were mistreated. He set conditions for their housing, care and maintenance and said they must go back as soon as a veterinarian he designated certified that the conditions had been met. He also ordered that no experiments be performed on the monkeys.

Alex Pacheco, whose allegations against the laboratory originally led to the seizure of the animals in a police raid Sept. 11, said a lawyer for his animal rights group was exploring the possibility of an appeal of Cahoon's ruling.

However, Edward Taub, the institute's chief researcher and the scientist who has been charged with animal cruelty, maintained that the group was in "complete violation" of the judge's order.

Montgomery County authorities and lawyers for Taub have engaged in a battle for temporary custody of the animals since they were seized. Prosecutors were attempting to have the monkeys remain in the Rockville home under police custody until Taub goes on trial Oct. 27 on the animal cruelty charges. But Cahoon yesterday ordered their return to the lab pending the outcome of court action.

Ingrid Newkirk, a spokesman for the animal welfare group, said she was "flabbergasted by the judge's order." She charged that he had refused to hear testimony by a "world-reknowned expert on primates and animal behavior" brought in by her group before making his decision.