A rough sleeper breached a court order banning him from Methil because he was desperate for a shower.
James McPhee was on the streets after finding himself locked out of his Lanarkshire home.
At the time he was subject to bail conditions barring him from entering the Fife town or contacting his ex-partner.
Kirkcaldy Sheriff Court heard he was found in her garden shortly before midnight.
‘Wanted to wash’
Fiscal depute Michael Robertson said: “The accused was released from custody with a condition not to enter Methil in Fife.
“At about 11.55pm on February 11, (the woman) was within the locus with her three children and the dog started barking.
“She looked out the window and saw the accused standing there.
“The accused requested entry, which was denied.
“He pleaded his case, as he had been sleeping in bus stops and wanted to wash.”
Mr Robertson said McPhee was told to leave or the police would be called.
The accused walked away but the complainer did contact police and McPhee was found a short distance away at around 12.25am.
Jailed
Solicitor David Bell, defending, said his client did not have a home to go to.
“He was released on bail with special conditions and since that was imposed he has essentially been living rough in the Kirkcaldy area.
“On one occasion, he was found in a derelict house and was charged with housebreaking.
“His position is he was trying to find a place to sleep for the night.
“He’s been doing drugs including cocaine whilst on the streets.
“He said he attended (the Methil property) to wash and shave.
“He’s not welcome there and he needs to accept that.”
Mr Bell added McPhee has a tenancy in Lanarkshire but had lost the key to the property and had been told it would cost £300 to change the locks.
McPhee, formerly of Kelty, admitted breaching a bail condition, initially imposed on January 30 this year, by entering Methil and contacting his ex on February 11.
Sheriff Timothy Niven-Smith jailed him for two months
For the latest court cases across Tayside and Fife, join our Courts Facebook page.