CENTRAL ISLIP, N.Y. (AP) _ A teen-ager who kept her newborn hidden in the closet for two weeks while she went off to school was given custody of the boy Monday, provided they move into a home for young mothers.

Shanta Clark, 17, was granted custody after she pleaded guilty to a lesser charge of neglect. She initially had been charged with child abuse.

``I wish you well. We definitely will be monitoring the situation,'' Family Court Judge David Freundlich told the girl, also ordering her to undergo drug and alcohol testing, and psychological and physical exams.

Miss Clark showed little reaction except for a shy nod to the judge.

``I feel great,'' said the teen's mother, Stephanie, who discovered the baby hidden in a closet of her home earlier this month. ``I feel sad that she'll be out of the home, but the baby will be reunited with his mother and that makes me feel good.''

Miss Clark secretly gave birth on Sept. 21 and hid the child in her room for 2 1/2 weeks while she attended school. She diapered and fed him each day after coming home. The newborn was placed in foster care after being treated at Stony Brook University Hospital.

The teen still faces a court date next month on additional criminal charges of endangering the welfare of a child.

The judge also said that Michael Johnson, 16, who said he is the baby's father, can undergo DNA testing to confirm his paternity.

``Like any father, I want to be able to support my kid,'' said Johnson.

Johnson said he had no idea Miss Clark had been pregnant.

``I woke up one day and I was a father,'' Johnson said outside the courtroom. He described their relationship as ``on and off,'' noting that they have seen more of each other since the baby's birth.

The judge also issued a gag order, preventing any of the parties from disclosing information about where Miss Clark and her son, Navorn Malik Clark, will be staying. Her attorney, Penny Glaser, would only say that the child and mother would be reunited ``in the very near future.''

Meanwhile, Miss Clark's 41-year-old mother was herself the subject of a court proceeding Monday. Her 7-month-old daughter was placed in foster care in March when the baby was found to be addicted to drugs.

In a separate proceeding, Freundlich rescinded unsupervised visits between Stephanie Clark and her baby because she had missed several appointments for drug treatment counseling. He said a social services caseworker must now be present during visits.