The girl had been living with foster carers for three months when police informed social services her foster father was suspected of having accessed images of child sex abuse before she lived there.
The girl also said she had been physically assaulted by another person in the house.
Social workers waited six days before deciding what to do and another week before removing the girl and another child from the house.
The foster father reportedly committed suicide soon after police began investigating him.
And in a further twist, it's reported that Bristol City Council spent £23,000 trying to prevent the media reporting the story.
The authority tried and failed to obtain a High Court injunction which would prevent embarrassing details of the case being made public.
Mr Justice Baker ruled it was in the public interest for the story to be published, but that the identities of the girl, her family and foster family should all be protected.
A Freedom of Information Act request has now revealed that the 'external cost' of the legal wrangle to Bristol City Council came to £23,528,40.
However, a spokesman for Bristol City Council today insisted the legal action was only taken to protect the identity of the child.
"The object throughout was only to protect the identity of the child," he said.
"It is important to realise that automatic reporting restrictions in respect of children subject to care proceedings do not last once the proceedings have ended.
"The council did not think that this was in the child's best interests and, as the press were already involved and had attended some of the hearings in relation to the care application, we considered that we had no option but to seek to protect the identity of the child beyond the care proceedings."
Mr Justice Baker said Bristol City Council's bid to cover up its errors was 'unjustified', adding: "It is in the public interest for these matters to be published."
The girl is now in a new foster home. But speaking at the time of the court hearing, her natural father said: "I am livid. They said she wasn't safe at home but they put her where someone had been downloading child abuse images."