
163 Cal.App.3d 525 (1985)
209 Cal. Rptr. 568
AKKIKO M., a Minor, Petitioner,
v.
THE SUPERIOR COURT OF THE CITY AND COUNTY OF SAN FRANCISCO, Respondent; DEPARTMENT OF SOCIAL SERVICES FOR THE CITY AND COUNTY OF SAN FRANCISCO, Real Party in Interest.
Docket No. A027068.
Court of Appeals of California, First District, Division Three.
January 11, 1985.
*526 COUNSEL
Sheila L. Brogna, Donna Wickham Furth, William J. Taylor and Brobeck, Phleger & Harrison for Petitioner.
Abigail English and Teresa Demchak as Amici Curiae on behalf of Petitioner.
No appearance for Respondent.
George Agnost, City Attorney, and Lisa A. Clay, Deputy City Attorney, for Real Party in Interest.
*527 OPINION
SCOTT, Acting P.J.
This petition by a minor dependent of the juvenile court (Welf. & Inst. Code, § 300)[1] challenges an order "recusing" Legal Services for Children, Inc., from representing her without charge in proceedings concerning her education and treatment. (1a) We conclude that the court erred in barring representation by counsel of the minor's choice without first ruling that the minor was not capable of choosing or did not select competent counsel.
Petitioner's first contact with juvenile court occurred in 1978, when a petition was granted, declaring her a dependent child of the court, as one whose home was unfit because of "neglect, cruelty, depravity, or physical abuse." (§ 300, subd. (d).) At that time she was entitled to appointment of counsel (§ 318, subd. (a)), but apparently was not separately represented. More recently, she was involved in court proceedings for voluntary commitment to a mental health facility (§ 6552) and proceedings to appoint a conservator (§ 5352). Legal Services for Children, Inc., a nonprofit law firm that represents minors without fee, was asked to advise her in connection with the former proceeding and was appointed to replace the public defender's office in the latter proceeding. The voluntary commitment proceedings ended when the Department of Social Services (hereafter the Department) filed the conservatorship petition, and the conservatorship proceedings terminated with a jury verdict that petitioner was not gravely disabled.
During the conservatorship trial, petitioner was placed temporarily in foster care. After trial, the court ordered continuation of foster care pending a placement decision by the juvenile court. At that point, petitioner asked Legal Services for Children to take legal action to allow her to stay in foster care and to obtain an appropriate educational program. Counsel took steps to arrange an educational program and filed a motion to modify petitioner's placement order to reflect her foster home placement. The Department agreed to continue the foster care.
While questions concerning petitioner's education and treatment were pending, the Department determined that Legal Services for Children no longer represented petitioner and so advised petitioner, her foster parent, and Legal Services for Children. Legal Services for Children sought a restraining order and/or preliminary injunction to prevent the Department from interfering with petitioner's relationship with counsel. The Department *528 countered with a motion to exclude counsel from acting as attorney for the minor. After hearing on both motions, the court issued an order "recusing" Legal Services for Children and appointing another attorney to represent petitioner. This petition followed.
Section 349 provides: "A minor who is the subject of a juvenile court hearing ... is entitled to be present at such hearing. Any such minor ... has the right to be represented at such hearing by counsel of his own choice." Petitioner argues that section 349 gives her an unqualified right to retain counsel of her choice, which she claims she has done. She contends the section's failure to impose an age restriction shows that the right applies to a child of her age (10 years old).
The Department argues that because of conflict between the minor and her guardian, the court was required by section 317 to appoint counsel for petitioner. Section 317 provides in pertinent part: "When it appears to the court that the minor or his parent or guardian desires counsel but is unable to afford and cannot for that reason employ counsel, the court may appoint counsel. In any case in which it appears to the court that there is such a conflict of interest between a parent or guardian and child that one attorney could not properly represent both, the court shall appoint counsel, in addition to counsel already employed by a parent or guardian or appointed by the court to represent the minor or parent or guardian...."
Even more compelling support for the Department's argument may be found in section 318, which provides that where the petition alleges abuse or neglect the court "shall" appoint separate counsel for the minor. Both section 317 and section 318 purport to require the trial court to appoint counsel for a minor in petitioner's position. However, we find no inconsistency between these sections and section 349. Sections 317 and 318 guide the trial court at the minor's detention hearing, which must be held before the end of the next judicial day after the petition has been filed (§ 315). Section 349 governs the dependency hearing, by which time it might be expected that the minor would have contacted counsel of his or her choice. Proceedings such as these, concerning education and treatment, are an outgrowth of the dependency hearing and are subject to the same procedures and right (see §§ 360-361). Even a minor initially represented by appointed counsel is entitled to seek a substitution of retained counsel for the dependency-related hearings to effectuate the right to counsel of the minor's "own choice."
The Department also argues that because petitioner is represented by a guardian ad litem she had no right to select her own attorney. The Child Abuse Prevention and Treatment Act provides that, in order for a state to *529 qualify for certain federal assistance, that state must provide "that in every case involving an abused or neglected child ... a guardian ad litem shall be appointed to represent the child." (42 U.S.C.A. § 5103.) Section 326 implements federal policy by providing that where a petition alleges neglect or abuse of the minor, "the probation officer or a social worker who files a petition ... shall be the guardian ad litem ... unless the court shall appoint another adult as guardian ad litem."
As a general rule, a minor must appear and enforce his or her rights in civil proceedings by a guardian ad litem. (See Civ. Code, § 42; Code Civ. Proc., § 372.) The Department contends that these statutes give the guardian ad litem exclusive control over the proceedings, including the authority to employ counsel.
In other contexts, the Department's argument might be persuasive. However, it is apparent that in these proceedings the guardian ad litem function of the Department is of a limited nature, designed primarily to assure federal assistance. Section 318 is critical to our analysis. It mandates a protective role for counsel appointed to represent an abused or neglected child: "(a) Notwithstanding the provisions of Section 317, 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.
"(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 *530 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. [¶] ..." (Ibid.)
It is apparent that many of the responsibilities normally associated with a guardian ad litem have been placed upon counsel. In light of the duties placed upon counsel by section 318, we reject the Department's argument that, as guardian ad litem, the Department controls litigation and retention of counsel for an abused or neglected minor. The Legislature intended that independent counsel, not the Department in its role as guardian ad litem, would control litigation and represent the interests of the abused or neglected child.
Section 318 requires the court to appoint counsel at the detention hearing and requires counsel to continue to represent the minor unless relieved by the court "upon the substitution of other counsel or for cause." This is compatible with section 349, which contemplates that a minor may wish at some point to substitute counsel of his or her own choice for appointed counsel. The court must permit substitution of counsel if it is satisfied that the minor is competent to select counsel and that counsel is prepared to meet the obligations imposed by section 318.
(2) We categorically reject petitioner's argument that a child of any age may choose his or her own counsel. Nor do we accept amicus' less extreme argument that the lawyer, not the court, should determine whether a particular minor understands the general nature of the legal proceedings and the lawyer's function and is able to reason sufficiently well to decide on a lawyer. Of course, as a first step, counsel has a duty to determine whether a minor who seeks his or her services is capable of selecting an attorney. But the court has the duty to determine whether substitution of "retained" counsel for counsel appointed under section 318 is required. In making that determination, the court must consider the minor's capacity to select counsel as well as the competence of counsel. The mandate that the court take "whatever appropriate action is necessary to fully protect the interests of the child," (§ 318, subd. (d)), is broad enough to permit court intervention when the minor has purported to exercise the right to select counsel of his or her "own choice."
(1b) The situation here is unusual (we hope) in that the court apparently failed to meet its obligation to appoint independent counsel at the minor's initial appearance in 1978. Nonetheless, we consider petitioner's election to be represented by Legal Services for Children as a request, pursuant to section 318, to substitute counsel of the minor's choice. In ruling on the *531 request, the trial court was obligated to honor the minor's choice of counsel (§ 349) if she was competent to choose and chose competent counsel.
Let a peremptory writ of mandate issue, directing the San Francisco Superior Court to vacate its "recusal" order and to reconsider petitioner's request for representation by Legal Services for Children.
Barry-Deal, J., and Anderson, J.,[*] concurred.
NOTES
[1]  Except as otherwise specified, all further statutory references are to the Welfare and Institutions Code.
[*]   Assigned by the Chairperson of the Judicial Council.
