Social services staff have come under fire after a family court judge heard 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, who is now nine.
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 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.
He has explained, in a written ruling on the case, how the boy had a "complex" family background.
The boy's mother, who has mental health difficulties, had separated from his father several years ago and was now in a lesbian relationship.
His father suffered from dwarfism, had a "problem with alcohol" and had a decade ago been convicted of having unlawful sex with a 16-year-old girl when 21.
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 added: "I am critical of the local authority for several aspects of the way it has worked this case."
He outlined a number of concerns.
"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)," said Judge Bellamy.
"(I am) even more concerned that an assessment was not undertaken at the point at which the local authority became aware that the (couple) had taken over as (the boy's) full-time carers.
"By then more than 15 years had passed since the last risk assessment.
"The local authority ought to have been aware of the fact that the approach to risk assessments has changed significantly over the course of those years.
"It should have appreciated that it was neither appropriate nor safe to rely upon the (1990s) risk assessment."
The judge added: "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."
He said the council had "meandered along" at a "slow pace" and there had been a "lack of any sense of urgency".
A clinical psychologist had carried out a psychological assessment of the man during family court proceedings, said Judge Bellamy.
He said Melissa Jackaman's report had been of great concern.
Dr Jackaman had described the man as a "high deviance individual" and had outlined the risks posed.
"(The man), has been falsely reassured that he is a low risk," Dr Jackaman had said.
"He continues to show some very worrying pro-offending attitudes in the form of distorted thinking patterns regarding children and sexual matters."
She had added: "In my opinion the (man) therefore presents risk to a female child within the family ... and I would strongly advise that he is not allowed any unsupervised contact with (a) young girl at all...
"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".