
179 Cal.App.3d 1046 (1986)
225 Cal. Rptr. 195
In re MELISSA S. et al., Persons Coming Under the Juvenile Court Law.
KERN COUNTY WELFARE DEPARTMENT, Plaintiff and Respondent,
v.
SUZAN L., Defendant and Appellant.
Docket No. F005970.
Court of Appeals of California, Fifth District.
April 11, 1986.
*1049 COUNSEL
Anderson & Anton and Jay C. Smith for Defendant and Appellant.
Bernard C. Barmann, County Counsel, and Philip E. Dunn, Jr., Deputy County Counsel, for Plaintiff and Respondent.
Hugh B. Fielder, under appointment by the Court of Appeal, for Minors.
*1050 OPINION
HAMLIN, J. 

PROCEDURAL BACKGROUND
On May 23, 1985, respondent Kern County Welfare Department (Department) became aware that 11-year-old Wendy A. and 6-year-old Melissa S. may have been molested by their stepfather, John L. Melissa was promptly taken into protective custody, but Wendy was not. A few days later Wendy retracted her charge of molestation. On May 28, the Department filed three petitions in the Kern County Juvenile Court alleging that Melissa, Wendy and their 14-year-old sister, Ellena A., were minors coming within the provisions of Welfare and Institutions Code section 300, subdivisions (a) and (d).[1] On the following day the court ordered that Wendy be taken into protective custody.
According to the allegations of the petition, the minors' home was unfit because both Melissa and Wendy had been molested by their stepfather and their mother failed to protect the minors although she knew of the molestation. While no allegations of molestation were made regarding Ellena, her home was deemed unfit because of the molestation of her sisters and the mother's failure to protect her daughters.
Initial hearings were held on all three petitions on May 29. The juvenile court's minute order is preprinted as to the nature of the hearing. With respect to Melissa, the clerk of the court checked the box indicating a detention hearing, but with respect to Wendy and Ellena, the clerk checked the box for a jurisdictional hearing. There is a capital letter "P" handwritten in front of the checked box, but its meaning is not clear. The only difference between the three minors was their custodial status, i.e., Melissa had been taken into custody, while Wendy and Ellena had not. However, as to all *1051 three minors, the basis for dependency was indicated as section 300, subdivisions (a) and (d).
Present at this initial hearing were the mother of the minors and appellant herein, Suzan L. (mother); the stepfather of the minors, John L.; Melissa's natural father, Greg S. (the natural father of Wendy and Ellena is deceased); and social worker Betty J. Pratt. The minute orders do not reflect that the minors were present. Gary Vincent was appointed to represent the mother, and the office of the public defender, represented by Russ Henry, was appointed to represent John L. All the allegations of the petitions were denied; nevertheless, the court found each of the minors was a person described by section 300, subdivisions (a) and (d). At the close of the hearing, the court ordered the Department to take Wendy into custody and place her in shelter care, upon its findings that (1) there was substantial danger to Wendy's physical health and (2) there were no reasonable means to protect her physical health except removal from the mother's physical custody. At that time Ellena was left in the mother's care. All three petitions were set for contested jurisdictional hearings on June 12, 1985.
On June 6, 1985, a supplemental petition pursuant to section 387 was filed regarding Ellena. The supplemental petition alleged that the previous court orders had not provided Ellena with effective parental care or control. Ellena had been taken into custody when it was determined that the mother was "placing unreasonable and undue pressure on said minor in attempting to intimidate said minor to not speak of said minor and said minor's siblings current situation contrary to said minor's emotional well-being." At the June 7 detention hearing on this petition, the court found Ellena to be a person described by section 387. Additionally, retained counsel Jay Smith was substituted to represent the mother. The juvenile court minute order reflects that the minor, Ellena, appeared before the court at this hearing. Again, all allegations of the petition were denied.
The contested jurisdictional hearing originally scheduled for June 12 was recalendared and held on June 11, 1985. Present at this hearing were social worker Pratt, represented by county counsel; Greg S., represented by counsel; and the mother, also represented by counsel. John L. was not present, but his attorney was at the hearing to represent him. The juvenile court minute orders do not reflect that any of the minors were present at this hearing. The minute orders also note that dependency was still premised on section 300, subdivisions (a) and (d). Nevertheless, pursuant to an agreement reached with the Department, the mother entered a plea of nolo contendere to the subdivision (a) allegations of the petition and the subdivision (d) allegations were stricken. The minors were found to be persons described by section 300, subdivision (a). At the close of the hearing, a dispositional *1052 hearing was set for June 25, 1985. The minors were ordered to remain in shelter care pending that hearing and to have no contact with John L.
Social worker Pratt filed an identical 18-page report as to each of the minors on June 21, 1985. The mother responded to these reports and submitted points and authorities opposing the social worker's recommendation that the minors remain out of her custody.
At the dispositional hearing on June 25, all three minors were adjudged to be dependent children of the juvenile court and placed in the care, custody and control of the Department for suitable placement. The court made all necessary findings and advisements. A review date was set for September 24, 1985. The mother appeals.

STATEMENT OF THE FACTS
We take our facts from the social worker's report. After receipt of an anonymous referral alleging that Wendy had been sexually molested by John L., the Department's emergency response worker, Nora McLellan, interviewed Wendy and her sister Melissa on May 23. Both minors stated John L. had sexually molested them. Wendy said John L. had fondled her and penetrated her vagina with his finger about one and one-half years previously at a time when John L. was a family friend and not living in the home. Wendy said she had told her mother about the molestation and her mother had responded "that's the worst thing you can do because John will go to jail. Don't tell anyone and we'll work it out."
Melissa also said she had been molested by John L. The act was fondling and digital penetration and it occurred when she, her mother, John L. and her brother Jeremy were all lying on the bed in the bedroom occupied by her mother and John L. She said John L. put his hands down her pants and touched her on her "pee pee." Her mother had been aware of that act and had been angry at John L.
Ellena stated that although she had not witnessed the molestation of Wendy and Melissa, both of them had told her what John L. had done to them. Jeremy's only statement was, "I ain't saying nothing. I don't want to get anyone in trouble."[2]
*1053 Kern County Sheriff's Deputy Sallee interviewed Melissa and Wendy on May 23. Both of them repeated to him their allegations of sexual molestation by John L. Melissa was taken into protective custody.
Social worker Pratt interviewed Melissa at Jamison Children's Center on May 27. When Pratt asked Melissa why she had been brought to the Jamison Center, she repeated her statement that she had been molested by John L. She then described the act of digital penetration. She also repeated her statement that the molestation occurred when she, her mother, John L., and her brother were lying on the bed together.
On May 29, prior to the detention hearing, Pratt interviewed Ellena, Wendy and Jeremy. Ellena and Wendy were very anxious and agitated during the interview. They retracted the statements they had previously made about being molested. Wendy said she must have been confused when she was interviewed by McLellan. She stated, "John isn't that kind of man." Both Wendy and Ellena were so anxious they were talking at the same time. On several occasions, Wendy said, "this is all my fault."

DISCUSSION

I.

Motion to Dismiss
(1) After the mother filed her opening brief on September 17, 1985, she advised this court that the Kern County Superior Court had modified the placement orders regarding Melissa and Wendy on September 30, 1985. Melissa and Wendy had been returned to the mother's custody on a trial basis; Ellena remained in out-of-home placement which the mother did not oppose. After the modification, the Department filed a motion to dismiss the appeal. The Department contended that since the mother had regained the custody of two of her three daughters and did not oppose continued out-of-home placement of the third, the material issues raised by the appeal had been rendered moot. This court denied the Department's motion by the following order: "Respondent's motion to dismiss the appeal on the ground of mootness is denied. Respondent has not shown how a temporary award of trial custody in the appellant, which is subject to review by the lower court, has rendered all of the issues raised in the appeal moot."
The Department has again raised the issue of mootness as its first argument on appeal. Initially we note the mother has appealed from the orders of the juvenile court rendered on June 25, 1985. Before the court refused to grant the mother custody of her children, it adjudged these children dependent *1054 children of the juvenile court. This adjudication is untouched by the restoration of custody to the mother on a trial basis; indeed, it is the ongoing nature of the dependency orders which permits the juvenile court to continue to supervise the mother and her minor children while in her care.
Moreover, this court appointed independent counsel for the minors, and in their opening brief the minors contend the dependency order must be reversed because the trial court failed to appoint counsel for them at the dependency hearing.
We therefore reject the Department's contention that the appeal has been rendered moot.

II.

The Trial Court's Failure to Appoint Counsel for the Minors
(2) We address first the minors' contention that the trial court's failure to appoint counsel to represent their interests at the dependency and subsequent hearings requires reversal.
At the time of the hearings, section 318 provided in pertinent part: "(a) Notwithstanding the provisions of Section 317 [pertaining to discretionary appointment of counsel], when a minor who is alleged to be a person described in subdivision (d) of Section 300 appears before the juvenile court at a detention hearing, the court shall appoint counsel. The court may appoint the district attorney to represent the minor pursuant to Section 351. [¶] (b) The counsel appointed by the court shall represent the minor at the detention hearing and at all subsequent proceedings before the juvenile court. [¶] (c) Any counsel upon entering an appearance on behalf of a minor shall continue to represent that minor unless relieved by the court upon the substitution of other counsel or for cause...." (Italics added.)[3]
The language of the statute is mandatory and does not leave appointment of counsel for a minor to the discretion of the trial court when the minor is alleged to be within the definition of section 300, subdivision (d), i.e., a child whose home is unfit because of neglect, cruelty, depravity, or physical abuse. In Akkiko M. v. Superior Court (1985) 163 Cal. App.3d 525, 527 [209 Cal. Rptr. 568], the court not only recognized the mandatory nature of *1055 the right to counsel afforded by section 318 but further held that a court must respect a minor's right to counsel of choice (see § 349) if the minor is competent to choose an attorney and chooses competent counsel. Similarly, the court in In re Patricia E. (1985) 174 Cal. App.3d 1 [219 Cal. Rptr. 783] held that even if joint representation of the county (through the social worker as guardian ad litem (§ 326)) and the minor is permissible, "it was error to fail to appoint independent counsel in the absence of an affirmative showing that the child's interests would be adequately represented." (Id., at p. 6.)
(3) There is nothing in this record to suggest that Ellena, Wendy, and Melissa, the subjects of a section 300, subdivision (d) petition, were given appointed counsel at the dependency hearing on May 29, 1985.[4] The language in section 318 makes its provision for mandatory appointment of counsel applicable at a detention hearing, i.e., a hearing had on behalf of a minor who has been detained. From such a literal reading of the statute, one could argue that only Melissa was entitled to appointed counsel at the hearing of May 29. However, such an argument is not persuasive for several reasons.
First, both Wendy and Ellena were taken into custody, i.e., detained, at a time when both were defined as persons falling within section 300, subdivision (d)  Wendy at the close of the hearing on May 29 and Ellena following a separate detention hearing on June 7, 1985. Therefore, if detention were the key element, counsel should have been appointed for both Wendy and Ellena before the contested jurisdictional hearing on June 11. More importantly, California Rules of Court, rules 1334(d) and 1363(d) are virtually identical, although rule 1334 applies to detention hearings, and rule 1363 applies to jurisdictional hearings. Both subdivisions make clear that when a minor is alleged to be a person coming within subdivision (d) of section 300, "the court shall appoint counsel for the minor." (Italics added.)
The Department argues first that section 318 was inapplicable in the instant case since none of the minors "appeared" at the hearing. It also urges that even if the trial court erred, no prejudice to the minors could have resulted since the section 300, subdivision (d) allegations were dropped when the mother entered a nolo contendere plea to the allegations of section *1056 300, subdivision (a). Only when a minor is alleged to be a person described in subdivision (d) is the court required to appoint an attorney.
The argument that section 318 is applicable only to minors who "appear" at the hearing, and since Melissa, Wendy, and Ellena were not present at the hearing of May 29, they were outside the protection of the statute, flies in the face of sections 315 and 349. Section 315 provides that a minor who has been taken into custody shall be brought before a judge or referee of the juvenile court for a detention hearing, and section 349 provides that "[a] minor who is the subject of a juvenile court hearing ... is entitled to be present at such hearing." Since Melissa clearly fell within the provisions of section 315 and Wendy and Ellena came within the provisions of either section 315 or section 349, depending on how the proceedings against them are characterized, the Department has done nothing more than to point out a further error of the trial court, assuming the minute orders are correct and the minors were not present.
Moreover, the Department's argument is illogical, at best. In arguing that a minor who is not present at a detention or other juvenile court proceeding is not entitled to appointed counsel, the Department is actually contending that such a child is entitled to no voice at all in a proceeding which will impact upon the child's ongoing relationship with a parent or guardian. Presumably, a minor who appears at the proceeding and is of an age and competency to do so can personally provide the trial court with information relevant to the appropriate determination. Similarly, a minor who is too young or otherwise unable to offer his or her input to the court but who appears at the proceeding will be guaranteed a voice through appointed counsel. However, were the Department's contention correct, a child of whatever age or competence who is not physically present at the hearing loses by default the only possible opportunity to be heard, i.e., the appointment of counsel for the minor with a statutory duty to protect the minor's interests. This contention simply makes no sense.
The Department's second argument  that the minors no longer had a right to appointed counsel at the dispositional hearing since the allegations under section 300, subdivision (d) had been dropped  cannot stand in the face of the clear statutory language. All three minors were entitled to counsel once they were brought before the court (or should have been brought before the court) on a petition alleging that they fell within the provisions of section 300, subdivision (d). Thus, all three minors were entitled to appointment of counsel on May 29 (or, in Ellena's case, no later than June 7), and by the express terms of section 318, counsel appointed at that time "shall represent the minor at the detention hearing and at all subsequent proceedings before the juvenile court." (§ 318, subd. (b), italics added.) Additionally, subdivision *1057 (c) of section 318 provides, "[a]ny counsel upon entering an appearance on behalf of a minor shall continue to represent that minor unless relieved by the court upon the substitution of other counsel or for cause." (Italics added.) Thus, had the court not erred at the initial detention hearing in failing to appoint counsel for the minors, such counsel would have continued to represent the minors at all further proceedings, even though the mother and the Department entered into some kind of an agreement to drop the section 300, subdivision (d) allegations.
In addition to the clear statutory language, the Department's argument, if accepted, would frustrate the legislative intent in enacting section 318. The Legislature has determined that counsel must be appointed for a minor once a welfare department alleges the minor's home is unfit because of neglect, cruelty, depravity, or physical abuse. The allegation of these facts in a section 300 petition triggers the mandatory provisions of section 318  not only the initial appointment but the continuing representation until relieved by the court. The focus of the statute is protection of the child's interest, and its efficacy is thwarted if the need to appoint counsel can be circumvented by simply dropping the subdivision (d) allegations prior to the dispositional hearing. Regardless of any "plea bargain" agreement between a welfare department and a parent, if the child's interests are unrepresented because counsel has never been appointed, the protection required by statute is sabotaged.
(4a) That the deprivation of counsel in the instant case was prejudicial, i.e., that the error may have resulted in a miscarriage of justice (In re Patricia E., supra, 174 Cal. App.3d at p. 6), is apparent when the statutory duties imposed on appointed counsel are considered in the context of what might have been done in the instant case. Section 318 was amended in 1980, adding subdivisions (d) and (e), which provide: "(d) The counsel shall be charged in general with the representation of the child's interests. To that end, he shall make such further investigations as he deems necessary to ascertain the facts, including the interviewing of witnesses, and he shall examine and cross-examine witnesses in both the adjudicatory and dispositional hearings; he may also introduce and examine his own witnesses, make recommendations to the court concerning the child's welfare, and participate further in the proceedings to the degree necessary to adequately represent the child. In addition, the counsel shall investigate the interests of the child beyond the scope of the juvenile proceeding and report to the court other interests of the child that may be protected by other administrative or judicial proceedings, including but not limited to, a civil action pursuant to subdivision (b) of Section 11172 of the Penal Code. The court shall take whatever appropriate action is necessary to fully protect the interests of the child. [¶] (e) Notwithstanding any other provision of law, counsel shall be *1058 given access to all records relevant to the case which are maintained by state or local public agencies. Counsel shall be given access to records maintained by hospitals or by other medical or nonmedical practitioners or by child care custodians, in the manner prescribed by Section 1158 of the Evidence Code."
The legislative history of the 1980 amendment to section 318 indicates the legislative purpose in specifically delineating the rights and responsibilities of counsel appointed to represent a minor in a section 300, subdivision (d) proceeding is to enable counsel to better protect the interests of the minor. (Sen. Com. Judiciary Rep. on Sen. Bill No. 782 (1979-1980 Reg. Sess.).) Particularly when, as in the instant case, the facts underlying the petition are isolated incidents involving Wendy and Melissa and the home environment of the minors in all other respects appears to be a healthy one, the efficacy of inquiry by counsel whose only interest is protecting a child is obvious.
As the report of the social worker in this case discloses, the initial report of molestation concerned Wendy and related an act occurring approximately a year and a half before. This report was anonymous. Moreover, the social worker's report also revealed that the three children involved, Ellena, Wendy, and Melissa, all appeared well-adjusted and deeply bonded to their mother and to one another. Finally, it was clear from the report that the children wished to be returned to their mother's custody.
Certainly the seriousness of the underlying conduct in this case, the molestation of Wendy and Melissa and the mother's apparent failure to protect her children, cannot be ignored. Similarly, the preference of a minor child is not determinative of his or her best interests. However, the only information considered by the trial court here was that prepared by the social worker, and her report recommended removing all four children (including Jeremy) from their mother's custody. As stated above, the court did not follow the recommendation with respect to Jeremy. It is apparent from all the circumstances that the trial court might well have benefited from additional evidence, assembled and presented by independent counsel, from the standpoint of the minors' best interests. Of course, it is impossible to state with certainty what additional evidence would have surfaced had counsel for the minors pursued, for example, interviews with other family members, neighbors, or teachers or independent examinations of the minors by qualified psychologists. Certainly the trial court could, and probably should, consider evidence bearing upon whether separation of the children from one another and from their mother would have a more severe emotional impact *1059 on them than remaining in their mother's care under supervision to insure John L. remained out of the family home.
The mother's challenge to the evidentiary support for some of the findings the trial court made to satisfy applicable statutory requirements presents some difficult questions. (5) When a welfare department's social worker has recommended a minor be made a dependent child and removed from parental custody, and when a parent has entered into a "plea" arrangement, conceivably to preclude adjudication of the more serious acts alleged in the petition, both the welfare department and the parent may have an interest in letting the allegations of the petition and the substance of the report pass unchallenged. This does not, however, assure that the best interests of the minor are being served, precisely the reason that independent counsel is statutorily required.
(6) In adopting the mandatory language of section 318, the Legislature has required that children who are the subjects of a petition under section 300, subdivision (d) be treated somewhat differently than children alleged to fall within other subdivisions of that statute. This state has a well-recognized interest in preserving the family unit; even a child whose home is allegedly unfit because of neglect, cruelty, depravity or physical abuse is not, on those bases, irrevocably removed from the home when the underlying circumstances come to light. By recognizing a greater need for an inquiry by independent counsel into the acts underlying a subdivision (d) petition, the Legislature indicates its intent that the trial court take into consideration such an independent investigation in making a dispositional order affecting the minors. (4b) The instant case, although serious, was not as egregious as many of the occurrences which have recently come to light in connection with the abuse of children, and, under these particular circumstances, we believe the trial court's error in failing to appoint counsel for the minors as required by statute was prejudicial. There is a reasonable probability a result more favorable to the mother would have been reached absent the error.
(7) Our conclusion that the trial court's failure to appoint independent counsel for the minors mandates reversal of the dependency order makes it unnecessary for us to consider the mother's contention the trial court's findings were not supported by substantial evidence. Suffice it to say that if the Department elects to pursue a section 300 petition to remove the minors from the mother's physical custody it will be required to prove that there are no reasonable means by which the minors' physical health can be protected without such removal.
*1060 We reverse the orders making the minors dependent children of the juvenile court.
Franson, Acting P.J., and Woolpert, J., concurred.
NOTES
[1]  All further statutory references are to the Welfare and Institutions Code unless otherwise indicated.

At all times relevant, section 300, subdivisions (a) and (d), provided: "Any person under the age of 18 years who comes within any of the following descriptions is within the jurisdiction of the juvenile court which may adjudge such person to be a dependent child of the court: [¶] (a) Who is in need of proper and effective parental care or control and has no parent or guardian, or has no parent or guardian willing to exercise or capable of exercising such care or control, or has no parent or guardian actually exercising such care or control. No parent shall be found to be incapable of exercising proper and effective parental care or control solely because of a physical disability, including, but not limited to, a defect in the visual or auditory functions of his or her body, unless the court finds the disability prevents the parent from exercising such care or control.... [¶] (d) Whose home is an unfit place for him by reason of neglect, cruelty, depravity, or physical abuse of either of his parents, or of his guardian or other person in whose custody or care he is...."
[2]  As the facts reveal, a fourth child, Jeremy A., was involved in these proceedings. Jeremy is the natural brother of Wendy and Ellena. Jeremy had also been the subject of a petition under section 300, subdivisions (a) and (d), and at the conclusion of the jurisdictional hearing on June 11, Jeremy was also found to be a person described by section 300, subdivision (a). Moreover, at the conclusion of the dispositional hearing on June 25, Jeremy was declared a dependent child of the juvenile court pursuant to that section and placed in the care, custody and control of the Department. However, the court directed that Jeremy was to be placed with the mother on a trial basis, and no appeal was taken from the court's order declaring Jeremy a dependent child of the juvenile court.
[3]  In 1985 subdivision (a) was amended, and the last sentence now reads, "The court may appoint the county counsel to represent the minor, if there is no conflict of interest between the county and the minor, or the district attorney pursuant to Section 351."
[4]  As noted earlier, the hearing on May 29 for Wendy and Ellena, who were not detained, was referred to as a "P" jurisdictional hearing. Although no transcript of this proceeding is before the court, the purpose of the proceeding seems to have been identical for all three children, and the time of the hearing was dictated by the fact that Melissa, who had been taken into custody, was entitled to be brought before a judge or referee of the juvenile court before the expiration of the next judicial day after the filing of the petition. (§ 315.)
