IN the middle of the night, a drunken trainee Army officer thought it would be a good idea to smash a woman’s window with a sword and threaten to “slay” her.

Hamish McGregor, a geology student at St Andrews University, took the three-foot weapon from his Officer Training Corps HQ during a drunken night out with his colleagues.

He then went to a random flat in the town, banged on the window and smashed a hole in it with the blade as Jennifer Cooper, 55, entered the room.

Fiscal depute Joanne Smith told Cupar Sheriff Court that Ms Cooper offered McGregor a glass of water as he leaned in through the window, at which point he said he would “slay” her while pointing the sword at her.

Ms Smith said: “About 1am Miss Cooper heard a noise at her window.

“She saw the accused with a sword and he started shouting, ‘Stand and deliver’. She called 999, at which point he started banging the window and shouting. She heard the glass smash then saw he was half in and half out of the window.

“She asked if he would like a glass of water so she could leave the living room to contact police again.

“She returned to make sure he had not gained access and gave him the water. When she stepped back he pointed the sword at her and stated he intended to ‘slay’ her.

“Officers approached the accused and took hold of him to prevent him from moving, but he refused to let go of the sword. An officer removed his baton and struck McGregor three or four times, which led to him dropping the sword.”

McGregor, 21, St Andrews, pleaded guilty to behaving in a threatening or abusive manner on November 13 in the town.

Douglas Williams, defending, said: “This was a bizarre incident which reflects behaviour that is completely out of character.

“The archaic language he used is perhaps indicative of his intoxication. The woman seems to have reacted with remarkable poise in what were frightening circumstances.

She saw the accused with a sword and he started shouting, ‘Stand and deliver’

Joanne Smith, fiscal depute

“He comes from a middle-class background, he has had a good education and is doing very well at university.

“He hopes to continue with the Officers Training Corps, but there will be a review of his position at the university following this.”

Sheriff William Wood ordered McGregor to carry out 140 hours of unpaid work on a community payback order and pay £400 compensation to Ms Cooper.

He said: “He should have moderated his behaviour when the police arrived. This was a very serious matter and very bizarre.

“Young training officers do engage in high jinks but, at some point, the game has to stop.”