Order of custody and disposition, Family Court, New York County (Susan K. Knipps, J.), entered on or about May 21, 2012, which, after a hearing, dismissed appellant father’s petition for custody of the subject child, and committed custody and guardianship of the child to petitioner agency and respondent Administration for Children’s Services (ACS) for the purpose of adoption, unanimously affirmed, without costs.
The court providently exercised its discretion in combining *602the dispositional hearing with the hearing as to whether extraordinary circumstances warranted awarding custody of the child to a nonparent.
The court properly found that extraordinary circumstances warranted denying the father’s custody petition, in that he failed to assume a primary parental role during most of the child’s life, and had a persistent pattern of criminal conduct which resulted in many convictions and long periods of incarceration. The father acknowledged that, although he lived with the child until she was three months old, he visited her only once during the time she was in foster care, and waited until the child was over three years old to file a custody petition, and that during his numerous incarcerations, the child developed a stable and loving relationship with her preadoptive foster mother (see Matter of Bennett v Jeffreys, 40 NY2d 543, 544-546 [1976]).
The court correctly determined that it was in the best interests of the child to commit custody and guardianship of her to the agency and ACS for the purpose of adoption, in that she was loved and cared for by the foster mother for most of her life, barely knew the father, and was thriving in the foster home (see Matter of Star Leslie W., 63 NY2d 136, 147-148 [1984]; Matter of Colon v Delgado, 106 AD3d 414, 414-415 [1st Dept 2013]).
Concur—Sweeny, J.E, Renwick, Andrias, Saxe and Kapnick, JJ.