
68 Cal.Rptr.3d 478 (2007)
157 Cal.App.4th 208
In re XAVIER G. et al., Persons Coming Under the Juvenile Court Law.
San Diego County Health and Human Services Agency, Plaintiff and Respondent,
v.
Rachel G., Defendant and Appellant.
No. D050977.
Court of Appeal of California, Fourth District, Division One.
November 27, 2007.
*479 William Hook, under appointment by the Court of Appeal, for Defendant and Appellant.
John J. Sansone, County Counsel, John E. Philips, Chief Deputy County Counsel, and Patrice Plattner-Grainger, Senior Deputy County Counsel, for Plaintiff and Respondent.
Valerie N. Lankford, under appointment by the Court of Appeal, for Minors.
AARON, J.
Rachel G. appeals a judgment terminating her parental rights to her minor sons, Xavier G. and Alex G., (together the minors) under Welfare and Institutions Code section 366.26.[1] Rachel asserts that the exception to termination of parental rights under section 366.26, subdivision (c)(1)(D) precludes termination of parental rights because there was insufficient evidence to support the court's finding that the maternal grandmother was willing to adopt the children. She further asserts that the court should have chosen guardianship rather than adoption as the permanent plan. We affirm the judgment.

FACTUAL AND PROCEDURAL

BACKGROUND
In October 2005 the San Diego County Health and Human Services Agency (Agency) filed petitions on behalf of two-year-old Alex and four-year-old Xavier under section 300, subdivisions (a) and (b). The petitions alleged that Alex was at risk of suffering serious physical harm after his mother placed him on train tracks on two different occasions, causing the trolley to have to make an emergency stop. The petitions further alleged that Rachel suffered from a mental illness and that she regularly abused drugs, resulting in her inability to properly care for the minors. In an interview with social workers, Rachel admitted that she smoked methamphetamines and that she was high on drugs when she placed Alex on the train tracks.
The court held a detention hearing. After finding that the minors were at risk of suffering physical harm, the court detained the minors in out-of-home care. Following a disposition hearing, the court removed the minors from Rachel's care and placed them in the home of a relative. The court ordered Rachel to comply with her case plan and scheduled a six-month review hearing. During the next six months, Rachel participated in a drug rehabilitation program. However, she continued to test positive for methamphetamines and admitted to ongoing drug use.
*480 The Agency placed the minors with their maternal grandmother (Grandmother) and grandfather (Grandfather). The Agency later discovered that Grandfather had been charged with driving under the influence in 2005. The Agency remained in favor of maintaining the minors' current placement as long as Grandfather did not drive the children anywhere or drink alcohol in their presence.
At the six-month review hearing, the court found that Rachel had not made substantive progress with her case plan and terminated reunification services. The court scheduled a section 366.26 selection and implementation hearing.
In an addendum report, the social worker reported that she had made an unannounced visit to the grandparents' home. The social worker noticed that Grandfather's breath smelled of alcohol and he admitted to having consumed two or three beers that day. Grandmother was not at home and Grandfather had been the sole caretaker of Alex that day. The Agency informed Grandmother that Grandfather would have to move out of the home for the children's safety. If he did not comply, the children would be removed from the home. Grandfather complied with the Agency's request and moved out of the home. About a month later, Grandmother asked whether Grandfather could return home. She did not believe Grandfather had a drinking problem.
Grandfather subsequently enrolled in alcohol abuse classes and began to attend Alcoholics Anonymous meetings. He did not believe he had a drinking problem. He stated he drank only occasionally, such as during a Sunday afternoon football game or on Monday evenings. Grandmother remained the primary caretaker of the minors. She told the social workers that she was willing to adopt the minors but that she would prefer a guardianship arrangement.
The social worker believed the maternal grandparents were not appropriate long-term caregivers for the minors. The social worker recommended that the minors be placed with their paternal aunt and uncle in Washington. The Agency subsequently filed petitions under section 387 alleging that the minors were not safe in their grandparents' care because Grandfather continued to live in the home with the minors.
In November 2006 the court ordered that the minors remain detained with Grandmother on the condition that Grandfather not live in the family home. The court allowed visits to take place between the minors and Grandfather in a supervised setting.
In January 2007 the social worker reported that the Agency had changed its position concerning the minors' placement. The Agency recommended that the minors remain in Grandmother's custody. The social worker believed the minors were adoptable because of their good health, young age, and pleasant personalities. In addition to paternal relatives in Washington, 13 other approved homes were interested in adopting a sibling set like Alex and Xavier...
In an addendum report, the social worker indicated that the Agency no longer intended to pursue the previously filed section 387 petitions. The paternal relatives in Washington had not received approval as a proper home. The minors continued to live with Grandmother. Grandmother agreed to comply with a list of requests set forth by the Agency to ensure the minors' safety. One of the requests was that Grandfather remain living outside of the home, for the minors' safety. At the time the addendum report was filed, Grandmother had been making good progress with the requirements.
In March 2007 the Agency withdrew the section 387 petitions and the court held a *481 section 366.26 hearing. The court heard testimony from the social worker relating to Rachel's visits with the minors. Visits sometimes took place at a drug rehabilitation facility, but in general, visitation was sporadic throughout the proceedings. The minors enjoyed seeing Rachel but expressed a desire to return home to Grandmother. The social worker recommended that the minors be adopted by Grandmother. Grandmother had been the minors' primary caretaker and they had become attached to her. The social worker believed that it would be detrimental for the children to be removed from Grandmother's care at this stage in the proceedings. The social worker also believed that Grandmother truly understood that the Grandfather must remain out of the home in order for adoption to move forward.
Grandmother did not testify at the hearing. All counsel stipulated that if she were to testify, she would express her preference for a guardianship arrangement, but that she was willing to adopt Alex and Xavier. In making his closing argument, counsel for Rachel agreed that Grandmother should be considered the prospective adoptive parent in this case.
The court found by clear and convincing evidence that the minors were adoptable and that none of the exceptions to adoption in section 366.26, subdivision (c)(1)(A) applied to preclude termination of parental rights. The court terminated Rachel's parental rights and referred the minors for adoptive placement.

DISCUSSION

I

There is Substantial Evidence That Section 366.26, subdivision (c)(1)(D) Does Not Apply
Rachel contends that at the selection and implementation hearing, the court should have applied section 366.26, subdivision (c)(1)(D), and chosen guardianship rather than adoption because of Grandmother's preference for a guardianship.
Our standard of review is the substantial evidence test, (In re Autumn H. (1994) 27 Cal.App.4th 567, 576, 32 Cal.Rptr.2d 535.) We determine whether there is substantial evidence, contradicted or uncontradicted, to support the conclusions of the juvenile court, resolving all conflicts in favor of the prevailing party, and drawing all legitimate inferences to uphold the lower court's ruling. (In re Brison C. (2000) 81 Cal. App.4th 1373, 1378-1379, 97 Cal.Rptr.2d 746.)
Adoption is the permanent plan preferred by the Legislature. (In re Derek W. (1999) 73 Cal.App.4th 823, 826, 86 Cal.Rptr.2d 739.) At the selection and implementation hearing, the court must terminate parental rights if the child is likely to be adopted within a reasonable time unless a statutory exception applies. (§ 366.26, subd. (c)(1).) There are six statutorily recognized exceptions to adoption. (§ 366.26, subd. (c)(l)(A)-(F).) These include an exception when the relative or foster parent caretaker is unable or unwilling to adopt because of exceptional circumstances (§ 366.26, subd. (c)(1)(D)). The parent bears the burden to establish by a preponderance of the evidence that an exception to the statutory preference for adoption applies. (In re Lorenzo C. (1997) 54 Cal.App.4th 1330, 1343-1345, 63 Cal. Rptr.2d 562; § 366.26, subd. (c)(1).)
Section 366.26, subdivision (c)(1) reads in relevant part:
"If the court determines ... by a clear and convincing standard, that it is likely the child will be adopted, the court shall terminate parental rights and order the *482 child placed for adoption ... unless the court finds a compelling reason for determining that termination would be detrimental to the child due to one or more of the following circumstances: [¶] ...[¶]
"(D) The child is living with a relative, foster parent ... who is unable or unwilling to adopt the child because of exceptional circumstances, that do not include an unwillingness to accept legal or financial responsibility for the child, but who is willing and capable of providing the child with a stable and permanent environment and the removal of the child from the physical custody of his or her relative, foster parent ... would be detrimental to the emotional well-being of the child."
The record contains substantial evidence that Grandmother was able and willing to adopt Xavier and Alex. The court correctly found that section 366.26, subdivision (c)(1)(D) did not apply; the requirements of the statute were not met. (In re Zachary G. (1999) 77 Cal.App.4th 799, 810, 92 Cal.Rptr.2d 20.) The fact that Grandmother preferred guardianship over adoption is irrelevant. As we have noted, "family preference is insufficient" to trigger application of section 366.26, subdivision (c)(1)(D). (In re Rachel M. (2003) 113 Cal.App.4th 1289, 1298, 7 Cal.Rptr.3d 153; see also In re Jose V. (1996) 50 Cal. App.4th 1792, 1797, 1801, 58 Cal.Rptr.2d 684.) The caretaker's preference for guardianship over adoption is irrelevant at a section 366.26 hearing, "where the court's task [is] to select the plan which best serve[s] the child's interests." (In re Jose V., supra, 50 Cal.App.4th at p. 1801, 58 Cal.Rptr.2d 684.)
Rachel relies on In re Fernando M. (2006) 138 Cal.App.4th 529, 535-538, 41 Cal.Rptr.3d 511 (Fernando M.) in which the reviewing court reversed the termination of the mother's parental rights, holding that the juvenile court had incorrectly found that section 366.26, subdivision (c)(1)(D) did not apply. The reliance is misplaced, since Fernando M. is distinguishable from the present case. In Fernando M., the reviewing court found that the evidence showed that the grandmother was unwilling to adopt because of exceptional circumstances, and that the case thus fell within the exception to termination in section 366.26, subdivision (c)(1)(D). (Fernando M. at pp. 536-537, 41 Cal.Rptr.3d 511.) The exceptional circumstances in that case included a special needs child and an objecting spouse. Here, the evidence does not show that Grandmother was unwilling or unable to adopt the children because of exceptional circumstances. Unlike in Fernando M., Alex and Xavier do not have special needs. Further, Grandmother does not have a spouse who objects to the adoption. Instead, both of the grandparents in this case are complying with the Agency's guidelines and the record does not indicate that Grandfather objects to the adoption. Grandfather actively participates in services, participates in alcohol abuse classes, and continues to live outside the minors' home. The social worker testified that Grandmother fully understands the Agency's guidelines and that she was following them at the time of the section 366.26 hearing.
The section 366.26 selection and implementation hearing occurs only after the juvenile court has found that the children cannot safely be returned to their parents' custody. (In re Josue G. (2003) 106 Cal.App.4th 725, 732, 131 Cal.Rptr.2d 92.) At that point, the focus of the law shifts from reunification to the child's interest in a stable and permanent placement. (In re Marilyn H. (1993) 5 Cal.4th 295, 309, 19 Cal.Rptr.2d 544, 851 P.2d *483 826.) By the time of the section 366.26 hearing, Alex and Xavier had been dependents of the court for nearly 18 months. Rachel continued to struggle with her drug addiction and the minors had since found stability and security in the home of Grandmother. Grandmother provided the minors with emotional and psychological support and actively participated in all aspects of their services, including therapy sessions. The minors needed permanency and the Grandmother was willing and able to provide them with a stable home. A guardianship that is established at the section 366.26 hearing is not a permanent situation because a child remains within the jurisdiction of the juvenile court. (§ 366.4, subd. (a).) Further, a guardianship is subject to change. Such an arrangement would not provide Alex and Xavier with the same level of stability as adoption would provide.

DISPOSITION
The judgment is affirmed.
HUFFMAN, Acting P.J., and McINTYRE, J., concur.
NOTES
[1]  Statutory references are to the Welfare and Institutions Code.
