High Bailiff Michael Moyle says those who spit at police can expect to go to prison.
He gave the warning after jailing a Castletown man for four months.
Jason Reed Brown of Douglas Road admitted the offence, but said he had no memory of the incident.
Mr Moyle described it as nasty and unpleasant and told him he was right to expect a prison sentence.
He added he was concerned about the number of people who thought spitting at police was funny, and warned those who did it could expect a stay in a prison cell.
Investigation underway after man dies in Barregarrow crossroads collision
Ribbon cut on fully refurbished M&S store
DHSC 'taking charge' of Noble's Hospital capacity issues
Manx Care and DHSC open to public meeting about Ramsey Cottage Hospital
Police still receiving reports of AI being used for 'cruel purposes' in schools