A 33-year-old man from the UK has been sentenced to two days in jail and banned from the island for vagrancy.
Peter Thomas Woosey admitted the offence and was said to be time served as he had been in custody for two days.
Magistrates issued him with a five-year exclusion order, banning him from the island.
Prosecuting advocate Rebecca Cubbon told the court that a member of the public contacted police to report Woosey in a sleeping bag outside the Sea Terminal on July 25 at 10.10pm.
Officers arrived and found the defendant lying against a wall.
He said he had arrived on the Isle of Man two days ago to see a friend.
However, he could give no details of his friend.
He said that he was trying to raise funds to get on the 7am sailing off the island.
When Woosey initially appeared in court he was argumentative and had to be restrained by security staff, before being taken back down to the cells.
He was then brought back into court later but security staff said that he had urinated over a door and the cell.
Woosey said he wanted to leave the island but swore in court.
The five-year exclusion order will come into force 28 days after it is issued, as this is the time period allowed for any appeal.
The defendant can be given financial assistance to leave the island by the police, if he leaves voluntarily upon his release from prison.


.jpeg?width=209&height=140&crop=209:145,smart&quality=75)

