A little boy born with cocaine in his system has been adopted against the wishes of his natural parents, following a Supreme Court ruling.

The six-year-old NSW boy, known only as Samuel, was taken away from his natural parents when he was seven months old following an order of the Children's Court.

He has remained with his proposed adoptive parents ever since and has an adoptive sister.

His natural mother suffers from schizophrenia, while his natural father suffers from a bipolar disorder.

There was evidence of violence and drug use by both parents around the time of Samuel's birth and he was born premature and tested positive for cocaine when he was a few days old.

Samuel's natural father opposed the adoption order in the NSW Supreme Court and sought joint custody of Samuel together with the foster family.

The court heard Samuel's natural mother also opposed the adoption, although she was not a party to the proceedings.

In his judgment handed down last month and published this week, Justice Rein noted Samuel's father had seen him only twice since he was born and then when he was under the age of one.

"He finds himself in a most unfortunate situation," the judge said, adding the father was unemployed, on a disability pension, had criminal convictions and lived in a one-bedroom government housing unit.

There was evidence Samuel was strongly attached to his adoptive parents and regarded them as his mum and dad.

"Samuel has been reared for six years as if he is the son of the proposed adoptive parents and reared appropriately in a loving, caring and stable environment," Justice Rein said.

The court heard an adoption plan would allow the father to see Samuel at least twice a year and he and the mother could give Samuel photographs and gifts at any time.

The judge allowed the adoption and ordered that Samuel could change his surname to that of his adoptive parents.