A convicted paedophile living in the grounds of a primary school will be evicted, after losing a court battle.
Parents were not told of Martin's background until he was convicted
Timothy Martin, 34, has been living in a school cottage at Beechfield School in Watford, Herts, since being offered the job of caretaker last July.
On Friday Hertfordshire County Council won the right to evict him on appeal in a civil case at Watford County Court.
Martin was found guilty of sexual activity with a child, at St Albans Crown Court earlier this month.
He was offered the caretaker job last year. Police checks had been carried out on Martin but no charges had been brought against him at that time.
The council started eviction proceedings as soon as he was charged last September, for an offence against a girl who was not a pupil at the school.
The proceedings were heard at Watford County Court in December but the judge refused to force Martin out, even though he had not signed a tenancy agreement.
The judge said under the law he had an assured short term tenancy agreement and was allowed to remain.
The council then tried to get the crown court judge presiding over Martin's criminal case to alter his bail conditions to say he could not live on the school grounds, but he also refused.
Parents were not told of Martin's background until after his conviction when they received a letter from the head teacher, who until then was legally bound not to inform them.
Measures were taken by the school to prevent Martin gaining access to its buildings, with security doors being kept locked and the head teacher monitoring children as they left the grounds.
On Friday Hertfordshire County Council was granted an immediate possession order for the caretaker's premises.
A council spokeswoman said: "We take child protection very seriously and have worked very hard within the legal framework to have Timothy Martin removed from the school site."
She added: "Measures have been taken by the school to ensure the safety of all the children attending the school, at all times.
"Hertfordshire police have supported the county council and the school in managing any risk throughout and will continue to do so."
Martin is due to return to St Albans Crown Court for sentencing on 12 June.