A family court judge has criticised council social services bosses after hearing how a boy spent at least two years living with a relative who was a convicted paedophile.
Judge Clifford Bellamy said staff at Leicester City Council had not undertaken a ''robust risk assessment'' of the man - a great-great-uncle who is in his 70s and had served a jail term after admitting sexually abusing a girl - when they learned that he was involved in caring for the boy.
He also said they had lacked ''any sense of urgency'' in bringing the case to the attention of a family court judge.
The judge has raised concerns after being asked to make decisions about the long-term future of the boy, now nine, at a family court hearing in Leicester.
He said the boy should be removed from his family and placed into foster care.
Judge Bellamy said none of the people involved could be identified.
The judge has explained, in a written ruling on the case, how the boy had a ''complex'' family background.
His mother had mental health difficulties and his father problems with alcohol, said the judge.
The great-great-uncle had been given an eight-year jail term in the early 1990s after being convicted of sexually abusing a niece when she was aged between 11 and 13.
He had admitted unlawful sexual intercourse and buggery.
Judge Bellamy said he had been released on licence after serving five years of the sentence and assessed as ''low risk''.
The judge said the great-great-uncle - and his wife - had always been involved in the boy's ''day-to-day care''.
He said the boy viewed them as grandparents.
Judge Bellamy said the boy had been made the subject of a ''child protection plan'' by the council more than five years ago.
The judge said it was clear at that stage that the council was ''aware of the significance'' of the great-great-uncle's ''involvement'' - he said an assessment had referred to the man being ''open about his conviction''.
At ''some point'' in 2013 the boy had moved to live with the great-great-uncle, and his wife, said the judge.
He said the council had become aware of the arrangement in November 2013.
Staff had held a ''child protection conference'' in December 2013 and a legal planning meeting in October 2014.
He said family court proceedings had not been issued until March 2015.
''The (great-great-uncle and his wife) have been involved in the day-to-day care of (the boy) throughout his life,'' said Judge Bellamy.
''He has lived in their full-time care for at least the last two years.''
The judge criticised "several aspects" of the way the council had "worked" the case.
"Given the gravity of the offences to which the (man) pleaded guilty, and notwithstanding the assessment undertaken in (the 1990s) which assessed him as a low risk, I am concerned that the local authority did not undertake a robust risk assessment once it became clear that the (couple) had a significant involvement in the care of (the boy), '' he said.
"It is a matter of equal concern that having become aware in November 2013 that the (couple) had taken over the full-time care of (the boy) that it was to be another 16 months before these proceedings were finally issued.''
A clinical psychologist had carried out a psychological assessment of the man during family court proceedings, said Judge Bellamy.
Melissa Jackaman's report had described him as a ''high deviance individual''.
''In my opinion the (man) therefore presents risk to a female child within the family," Dr Jackaman had said.
"I would strongly advise that he is not allowed any unsupervised contact with (a) young girl at all."
She had added: "Whilst I think the risk of sexual abuse towards (the boy) is less, unfortunately it cannot be totally ruled out. The reason is that high deviance individuals have been found to have a greater likelihood of cross-over offending.''
Dr Jackaman had said (the boy) was ''malleable'' and ''compliant'' and she said the man's ''understanding of sexual matters'' was ''very skewed, unhealthy and dysfunctional''.