Magistrates jailed a man after hearing of his regular bowel habits at Todmorden Health Centre.
Raymond Woods, 56, used the toilets over a two month period leaving faeces on the floor.
Woods, of no fixed abode and with 147 previous convictions, admitted breaching an anti-social behaviour order.
He was jailed for 17 weeks and Calderdale magistrates imposed a five year ASBO starting from his release.
The conditions include not entering the health centre unless he has a pre-arranged appointment and not drinking alcohol in a public place in Calderdale.
Clare Benson, prosecuting, said Woods left mess and faeces and when staff would no longer clean-up after him the toilets were locked and the public had to ask staff for a key.
“On July 20 the defendant found them locked and stood in the waiting room saying `shall I crap on the floor`,” said Miss Benson.
When he started to take his trousers down a member of staff unlocked the toilet door.
He then realised his cider had been taken and started shouting and swearing at staff and patients.
Woods told police he could not remember the incident and had drunk nine litres of strong cider.
Asamh Khalid, mitigating, said her client accepted what he had done.
“He does have a record - 147 convictions,” she said.
The court heard Woods’s family moved from Manchester to Todmorden in the 1980s and he increasingly turned to drink after the deaths of relatives.
Magistrates said his behaviour at Todmorden Health Centre was so serious only a custodial sentence could be justified.