DOVER, Del. (AP) _ A judge has ruled that a boy put in the custody of his babysitter four years ago because he had spent so much time with her should be returned to his mother as soon as possible.

The ruling by Superior Court Judge Clarence Taylor in Wilmington sent the matter back to Family Court for a second time and ordered a new judge for the case. It also gives the state Division of Child Protective Services custody of 7-year-old Daryl King pending further court action.

Tuesday's decision came in the second appeal by Brenda King, 27, who lost custody of Daryl to his babysitter, Dorothy Marx, 47, and her husband, James, 48, in 1981.

On the first appeal, Taylor had sent the case back to Family Court Judge James Gallagher, who stood by his initial decision. Gallagher said Daryl had been raised by the Marxes to the point that he was no longer Mrs. King's son. Gallagher did not cite abuse nor neglect on the part of Mrs. King.

Mrs. Marx had no immediate comment on the decision when reached at her home in Bellefonte.

Mrs. Marx returned Daryl to Mrs. King's home Tuesday evening but said nothing about the decision, Mrs. King said.

''She hadn't told him (about the decision). She was like nothing ever happened. Daryl said she had gotten two phone calls and was crying,'' Mrs. King said, adding Mrs. Marx did not bring any of Daryl's personal belongings.

''It's about time. I was just so happy I was flabbergasted,'' Mrs. King said in a telephone interview from her home in Christiana Falls.

She said that when she told the news to her oldest son, 11-year-old Phillip, he cried.

''I've been a nervous wreck. Waiting for this decision has been the worst of all of them. I was more scared for him more than myself because I don't think he can take another disappointment,'' she said.

Taylor's decision said, ''The overwhelming weight of expert and investigative findings and opinion is that with guidance and assistance, Brenda's capability to provide care for Daryl did not and would not threaten or impair Daryl's physical, mental or emotional health or well-being.''

The ruling ordered Family Court or the state to take interim action to return Daryl to his mother unless it could be established that such return would ''threaten Daryl's physical, mental or emotional well-being.''

A Family Court hearing on returning custody of Daryl to Mrs. King could be held within days or a week, or the state could move on its own, said Carolyn Schlecker of Community Legal Aid, one of Mrs. King's attorneys.

In spite of the ruling, Mrs. King will ''never get those years back,'' Ms. Schlecker said. ''It really takes the joy out of this decision. It's been extremely hard over the years to watch Brenda go through this and defend the judicial system to Brenda.''