A state judge has refused to terminate the parental rights of a recently released inmate, blocking, at least for now, the attempt of his 5-year-old son’s foster parents to adopt the boy.

Nassau County Family Court Judge Edmund M. Dane ruled that he could not make a finding of permanent neglect on the part of the father, Peter D., because the county Department of Social Services had failed to make “diligent efforts to strengthen and encourage” Mr. D.’s relationship with his son while the father was in prison.