A convicted paedophile has won more than £3,000 in damages from North Yorkshire Police for wrongful arrest.
Robin Frampton, 53, of Southampton, was arrested in Selby in July 2006 for giving false details and failing to register a change of address.
The serial sex offender was held in custody for 110 days before the charges were dropped.
The force has also been ordered by a judge at Leeds Crown Court to pay more than £20,000 in legal fees.
Judge Penelope Belcher agreed Frampton was wrongly arrested and imprisoned by police.
However an additional claim against the force for malicious prosecution was rejected.
She said: "I do not doubt for one moment the integrity of the police officers.
"They genuinely believed an offence had been committed."
Judge Belcher described the police involved as "honest, genuine police officers carrying out their public duty".
In 1999 Frampton, who is also known as Robert Williams, was put on the sex offenders register for life after an attack on a prostitute.
He was jailed in 1980 for the attempted rape of a young girl and again in 1989 for raping a pensioner in her own home.
The court heard how Frampton travelled to Selby to stay with his girlfriend, who he had met through a television dating service.
When he got to the town he went to a police station to inform them that he was staying in the area.
He showed officers a document with the name Robert Williams and an incorrect address for his girlfriend's house.
He also claimed his placement on the sex offenders register had expired, the court heard.
Frampton told police that he had got his girlfriend's address wrong because he had never met her.
The court heard that detectives arrested Frampton, believing he had failed to register his new address within the three-day time limit given to sex offenders.
Frampton received £3,075. It is thought that the case has cost taxpayers more than £20,000.
Speaking after the case, Det Ch Supt Richard Mann said the actions of police had been "entirely right" in the circumstances.
He said: "Right from the outset of this case North Yorkshire Police has been determined to defend this issue in public rather than agree to an out of court settlement.
"We obviously accept but are naturally disappointed that the court has ruled against us, albeit Frampton lost on a major part of his claim."