A sex offender moved to Fife, started a relationship with a mother-of-two and had unauthorised contact with children.
Stephen McNally, a convicted rapist, was subject to a Sexual Offences Prevention Order (SOPO) to protect the public and severely restricting any contact with children.
This order was imposed in Edinburgh but when McNally moved to Cowdenbeath and started a new relationship with a woman he failed to tell police.
This relationship, started via Facebook, led to him have contact with the pre-teen children.
Stephen McNally, 38, of High Street, Cowdenbeath, appeared from custody at Dunfermline Sheriff Court.
He admitted that, being subject to a Sexual Offences Prevention Order granted at Edinburgh Sheriff Court on April 18 2013 prohibiting him from unauthorised contact with children under the age of 17, he breached this order.
On various occasions between March 1 and August 26 2016, in Cowdenbeath, he breached the conditions of the order by being in contact with children without the permission of his offender manager.
He also admitted breaching another condition between February 1 and August 26 2016 Â by failing to inform his offender manager that he has started a relationship with the woman.
McNally, who was jailed for rape in 1998, is currently serving a prison term for another breach of his SOPO conditions.
Depute fiscal Kyrsten Buist told the court that McNally had been spotted with the woman by an off-duty policeman in Cowdenbeath High Street.
The matter was reported and when CCTV of the area was viewed it showed McNally with the woman and a child.
When questioned by police about this, McNally claimed the woman had just been someone he had spoken to in a pub earlier that day.
However, when the woman was interviewed she told officers that she was in a sexual relationship with McNally and he had regularly been in contact with the children.
Sheriff Craig McSherry jailed McNally for 16 months to run consecutively to his current term which ends in September.