A classroom assistant was "totally shocked" to find a man intending to spend the night in a classroom at Maesydre school when she responded to a burglar alarm.

Welshpool Magistrates Court heard Alexander Macura, aged 64 and currently living at a caravan park in Lancashire, was prohibited from entering a school premises by a risk of sexual harm order, but had forced his way into the school building via an open while looking for somewhere to sleep.

He pleaded guilty to two charges of Breaching a Sexual Harm Order on May 21.

Ms Helen Tench, prosecuting, told the court that the classroom assistant had been responding to an alarm at the building on Friday, May 18, when she had discovered Macura at the school.

After resetting the alarm she noticed a sensor-activated light had come on in the girls toilet in the school building, and when she went to investigate she came face to face with a "unkempt and dishevelled" man holding a Morrisons bag.

She told him to leave and dialled 999, but on returning to the scene noticed some damage to the doors at the entrance to the school, while Macura made off in the direction of the canal.

When interviewed by Police, Macura said he had been looking for somewhere to sleep and after failing to find anywhere suitable at the rugby club had gone to the school to bed down for the evening.

Mr Robert Hanratty, in mitigation, said Macura lead a "transient lifestyle" by choice and had some cognitive impairment.

Macura was sentenced to a community order lasting for two years, to include a rehabilitation requirement of 30 days of rehabilitation activities, having already served 27 days in custody while on remand.

He was also ordered to pay £150 compensation in respect of the broken lock on the school doors, and ordered to pay costs of £85.