—In an action for a divorce and ancillary relief, the father appeals (1) from an order of the Supreme Court, Queens County (Satterfield, J.), dated February 5, 2001, which denied his motion to vacate a prior award of custody of the parties’ son to the mother, and granted that branch of the mother’s cross motion which was for an award of counsel fees, and (2), as limited by his brief, from stated portions of a resettled judgment of the same court, entered March 19, 2001, which, inter alia, awarded custody of the parties’ son to the mother.
Ordered that the order is affirmed; and it is further,
Ordered that the resettled judgment is affirmed insofar as appealed from; and it is further,
Ordered that one bill of costs is awarded to the respondent.
It is well settled that in determining the issue of parental custody of a child, the primary concern is the best interests of the child (see Matter of Welsh v Lewis, 292 AD2d 536; Matter of *566Acosta v Acosta, 259 AD2d 747). The court must look at the totality of the circumstances, and consider, inter alia, the relative fitness of the parents, the quality of their respective home environments, the quality of parental guidance, and the ability of each parent to provide for the child’s emotional and intellectual development (see Matter of Brown v Dilone, 258 AD2d 650; Santoro v Santoro, 224 AD2d 510). The determination of custody is a matter entrusted to the sound discretion of the trial court, which is in the most advantageous position to evaluate the testimony, character, and sincerity of the parties (see Santoro v Santoro, supra; Hudson v Hudson, 279 AD2d 659). Its determination will not be set aside unless it lacks a sound and substantial basis in the record (see Matter of Lynch v Acey, 281 AD2d 483; Vecchiarelli v Vecchiarelli, 238 AD2d 411).
In the instant case, the Supreme Court’s custody determination is amply supported by the record. Among other things, the court considered the fact that the mother had been the child’s primary caretaker. The court weighed the parties’ credibility, as reflected in a record describing eight years of a turbulent marriage, punctuated by persistent acrimonious litigation. The court also considered the father’s history of domestic violence, as well as the testimony of the child’s therapist, school teacher, and the opinion of the Law Guardian. The court was not obligated to accept the recommendation of the court appointed forensic expert (see Matter of Maysonet v Contreras, 290 AD2d 510; Matter of McCoy v McCoy, 277 AD2d 384), and explained its reasons for disregarding the expert’s recommendation (see Berstell v Krasa-Berstell, 272 AD2d 566), for which there is a sound and substantial basis in the record (see Matter of Maysonet v Contreras, supra; Matter of McCoy v McCoy, supra; Berstell v Krasa-Berstell, supra; Matter of Hopkins v Wilkerson, 255 AD2d 319).
The father’s remaining contentions are without merit. Altman, J.P., S. Miller, McGinity and Schmidt, JJ., concur.