A man has been charged to court following multiple allegations of bestial assault of farmyard animals at a high school in Western Sydney, Australia.

Police allege the 43-year-old man broke into St Mary’s Senior High school five times over a period of three weeks to sexually assault goats and sheep housed within the school’s agricultural farm.

The school runs agriculture classes and has a farm on the premises where it has birthed lambs and kids.

The man first allegedly entered the school grounds on April 27, according to police, leading the school to install CCTV which they said “captured vision” of later alleged offences until Wednesday, May 18.

The man was arrested on school grounds, in Kalang Avenue, St Marys at 7.50pm on the same day, May 18.

The man was then taken to St Marys Police Station and he is set to appear in court next Thursday, May 26.

“All animals on site at the school have been examined by a veterinarian and are all in a stable condition,” a New South Wales Department of Education spokesperson told 7News.com.au.

“The school has increased security and surveillance on site, including the area where the animals are held.”

Police said they commenced investigations after receiving reports of alleged break and enter offences at the school.

The man is due to face a total of 14 charges in Penrith Local Court next week, with five of those charges relating to break and enter offences and six related to animal cruelty and bestiality.

He has been refused bail and prior to his court appearance.