A Melrose farmer drove an agricultural digger at a university professor in a neighbourly dispute, Selkirk Sheriff Court has been told.

James Morton was then involved in a violent struggle with police officers in a cow shed which ended up with them falling into an animal waste pit.

Details of the bizarre bust-up emerged last week when the 37-year-old was fined £540 after admitting a charge of threatening or abusive behaviour.

Graham Fraser, prosecuting, explained how there had been a long standing neighbourly dispute between the farm at Kaeside, near Melrose, and the home of Dr. Britta Kalkreuter who is an professor at the School of Textiles and Design at Heriot Watt University, and her husband.

At lunchtime on November 22 she heard a banging noise outside her home and walked down the access road with an Ipad for filming purposes to investigate.

Mr Fraser explained how Morton was in a JCB with a bucket in front digging up earth and on seeing his neighbour drove at a steady speed towards her.

He added:"It stopped so close to her she could physically touch the vehicle."

The police were contacted but Morton would not speak to the officers when they arrived.

Police officers viewed the video footage on the Ipad and took the view it was a "deliberate attempt to intimidate" the neighbour.

Mr Fraser said Morton then ran off into the cow shed and was involved in a violent struggle with the officers which resulted in them falling into animal waste stored in the shed.

He continued: "During the course of the struggle a set of keys came away from a constable as well as a warrant card. The keys were never found."

After being cautioned and charged Morton insisted Ms Kalkreuter should have moved out of the way of the digger.

Defence lawyer Mat Patrick said his client should be given a degree of sympathy as he had been engaging with the Scottish Environmental Protection Agency and had spent thousands of pounds trying to rectify drainage problems in the area.

He explained that Ms Kaulkreuter and her husband had reported the farm to SEPA on three occasions and the Scottish SPCA four times.

Mr Patrick added:"It has been going on for some time and he was at the end of his tether.  He felt it was a vendetta when he saw her holding the Ipad and that it was being done to provoke him.  Unfortunately he has bitten and lost the rag. He has accepted that."

He explained that the incident with the police arose because Morton had panicked.

Mr Patrick concluded:"He just wishes he and his neighbour could stay apart and there are legal ways to avoid this. It is a situation which needs to cool down."

Morton, who has a previous conviction, had a fine of £600 imposed by Sheriff Adrian Cotham reduced to £540 due to the guilty plea.