A woman who stabbed a man as she ran around a busy market square brandishing a large kitchen knife and shouting "kill, kill, kill" has been ordered to be detained in hospital.

Ayaan Ali, 29, stabbed shopper Andrew Froggatt in the centre of Barnsley and also tried to attack another man who fought her off with his window cleaning bucket, Sheffield Crown Court heard.

On Tuesday, Ali, who has paranoid schizophrenia, was found guilty of attempted murder, possessing an offensive weapon and affray, court officials confirmed.

Judge Peter Kelson QC ordered her to be detained indefinitely in hospital.

A jury heard that Ali bought a pack a knives from a discount store within minutes of arriving at Barnsley's transport interchange on Saturday September 8 last year.

Prosecutors said witnesses saw her running around the market stalls shouting "kill, kill, kill" before she "set her sights" on Mr Froggatt, who was walking through the town centre intending to get a key cut.

She stabbed him in the shoulder before chasing him and then trying to attack window cleaner Mark Watson.

In a video interview played to the jury, Mr Froggatt said he ran after feeling an impact to his shoulder and turning to see a woman with a large carving knife, which he thought was about 12in long.

He said: "She was brandishing the knife and going, 'Kill, kill, kill. That's all she said: 'Kill, kill, kill'."

Bank worker Kaye Asquith described in a statement how she frantically tried to shut the automatic doors of her branch when she saw Ali coming towards her brandishing a knife.

Ms Asquith said she was "absolutely terrified" and added: "She was attacking people at random."

Ali, from Isleworth, west London, was arrested at the transport interchange around 30 minutes after she arrived in the town centre.

Judge Kelson told the jurors there was no dispute that it was Ali with the knife in the square.

He said the issue for them to decide was "about the defence of insanity".

Prosecutors said the question for the jury was whether Ali knew what she was doing and whether she knew what she was doing was wrong.

By Dave Higgens