A D.C. Superior Court judge yesterday placed a 5-year-old boy in court custody and prosecutors accused the child's mother of neglect after a police officer testified that unexplained traces of barbiturates were found in the child's blood and mysterious needle marks on his arms.

After the hearing before Judge Sylvia Bacon, the mother, Mary Thompson, wept in the court corridor. "I haven't given my kid any drugs," she said. "This is ridiculous. Is this what justice is all about? I can't believe this is happening."

Yesterday's hearing was the latest development in a week-long drama that began last Thursday when Thompson's 5-year-old son told a teacher at Parkview Elementary School that a doctor had stuck needles in his arm and showed the teacher the marks.

School officials, fearing the marks may have come from drug injections, called city social workers, who in turn contacted police.

The police took the child to D.C. General Hospital for an examination and ordered blood tests, whose results were returned yesterday. Meanwhile, police obtained a court order to keep the child from his mother until the results of the test were available.

Yesterday police officer Alan Sylier told Judge Sylvia Bacon that the tests showed two barbiturates in the child's blood -- amobarbital and secobarbital. Both durgs are used in several children's medicines, but not in Triaminic, a cough syrup that the mother said was the only drug she had knowledge of her child taking.

Thompson appeared in court with a court-appointed lawyer whom she first met five minutes before the trial. She seemed dumbfounded after the officer's testimony.

"This is stupid," she said outside the courtroom, her eyes filled with tears. "If (my son) has barbiturates in him, I definitely want to know where they came from. I know I didn't give them to him.The only medication I have ever given him is cough syrup. This is absolutely bizarre. I can't believe this is happening."

Older students at Parkview school, located at Warder and Newton streets NW, had taken Thompson's son to a teacher last Thursday after the boy became involved in a classroom fight. The teacher, Beryl Burns, told a reporter last week that she had been very concerned about the boy because he is hyperactive. Burns asked the 5-year-old if he had ever been to the hospital.

In the course of the conversation, the teacher said, the child said, "Needles make me feel better."

The teacher said she took the child to the principal's office, wher he recounted the story. The principal, Shirley Hayes, said she and the teacher had been quite concerned about the boy because of his behavior. He moves around the room frequently, fidgets in his chair and hits other children, the principal said.

They had been trying to have a conference with the child's mother, but, according to Hayes, they had been unable to contact her. After hearing the child's story and looking at the marks on his arms, Hayes said she called the child protective services of the Department of Human Services.

That agency called police, who sent officer Alan Sylier from the youth division to interview the boy. Sylier said after he heard the child's story, saw the marks on his arm and talked to school officials, he took the child to D.C. General Hospital.

He also called a nursery school director whose address appeared on the child's school records. The director said she would contact the child's mother.

Thompson, who lives in Silver Spring, said she received the message that the police had her son at 3:30 p.m., while she was working at her cashier's job at a department store. However, she was told that she would not be able to talk with Sylier until 6 p.m. At 5:55 p.m., she called the youth division and was told that she would have to go to the youth division to find out about her son.

Placing the child's birth certificate in her purse because she feared that he had been in a fight and gotten hurt, she went to the youth division, Thompson recalled in an interview. There, she said, her nightmare began.

She said the officer immediately accused her of shooting up her child with drugs. "I rolled up my sleeve and showed him my arms," she said last week as she sat in her neatly furnished apartment. "He said, "Did you shoot up your son?' I said, 'No.' He said, Terry [her boyfriend] did it. I told him Terry didn't. Then he accused me of having other boyfriends and that one of them did it. I told him nobody shoots up my son with drugs."

Then, Sylier asked her if she had any explanation for the marks on her son's arms. She said she told him that the needle marks and the story probably came from the blood and tuberculin skin tests the boy had taken three weeks earlier.

She said the boy had been afraid to take the tests. But she and her boyfriend had assured the child that the needle would make him feel better and that both of them also had to take needles, she said.

Shortly after the bloodsamples were taken from the child last week, Dr. Joseph Schutt-Aine, the pediatrician in charge of the case, said the marks on the boy's arm could have been needle injection sites, but could also have been caused by a minor injury. "They would not strongly suggest needle marks to me," he said. "They are not tracks . . . they are just two little dots that could be due to anything.

"There is no strong suspicion we can have from the physical evidence," Schutt-Aine said. "The strong suspicion would come only from the way the child was acting at school and what the child said."

Schutt-Aine said the drugs could have entered the boy's system either orally or through injection and could be discovered in blood tests perhaps as much as two days later. The blood tests were done by Biomedical Reference Labs in Burlington, N.C.

Thompson said she uses a District address on her child's school record so the boy can attend the school near the nursery that a younger brother attends.

Bacon yesterday set a trial date of Jan. 6 and ordered the child into a foster home pending the outcome of the trial.

"I'm no junkie," Thompson said as she prepared to leave the courthouse yesterday.

In an interview last week, Thompson attributed the city officials' actions to fear of dchild abuse that was spawned by an article in The Washington Post on an 8-year-old heroin addict, identified only as "Jimmy."

"That's why they're on me," she said. "Because of Jimmy."