HAUPPAUGE, N.Y. (AP) _ A 10-year-old boy has gone on trial in open court for selling crack cocaine, despite his lawyer's pleas that the case be closed to the public, as is the case in most Family Court proceedings.

Suffolk County Family Court Judge Donald Auperin cited society's concern over drug abuse in ruling Tuesday that the case should be tried before the public.

''This is a tragic story of a young boy who may have been at the wrong place at the wrong time,'' the boy's Legal Aid lawyer, Douglas O'Connor. ''It wasn't his fault that he lives in a place where these types of things take place. He did not choose the place where he lives.''

The boy, whose name the judge asked the press to withhold, lives with his family in a poor neighborhood in Wyandanch, a suburban Long Island community about 20 miles east of New York City.

The 5-foot-tall defendant appeared bored and at times sleepy as four Suffolk County police officers took the stand to describe the events that led to his arrest Jan. 15.

Two officers testified that they saw the boy and his 14-year-old companion selling crack from a BMX dirt bike that they rode up and down Straight Path in Wyandanch, an area known for drug-dealing.

When police moved into arrest them, an officer testified, the 10-year-old threw away a brown paper bag that was found to contain three plastic bags of crack, worth $20 each. The two boys were found to be carrying $226. The older boy is being tried seperately.

During an intermission in the two-hour proceeding, he began to cry. A court officer asked his mother to comfort him, and she walked over and patted him on the shoulder, which seemed to calm him.

When Tuesday's session was over, O'Connor asked if the child could go home for the night, but the judge refused and ordered him taken to the Nassau County Children's Shelter, where he has been held for the past two weeks.

As the child was handcuffed and led out, he called out in a choked-up voice, ''Mommy, are you coming back tomorrow?''

His mother called back, ''Yes, yes.''