A man killed his drug dealer after a row over £10 and "dud" Valium tablets.

William Paterson, of Lismore Avenue, Kirkcaldy, pleaded guilty to culpable homicide at the High Court in Edinburgh on Friday.

He repeatedly stabbed James Beveridge on the head, neck and body during the attack in the Fife town on October 15 last year.

The court heard how 46-year-old Paterson had fallen out with Mr Beveridge, 41, because he wanted to buy drugs on credit.

Police also suspected Paterson wanted refunded over "dud" Valium tablets he had previously purchased from Mr Beveridge.

The dealer refused to do business and, after the pair exchanged text messages, they met up with each other.

Prosecution lawyer Ashley Edwards QC told the court Mr Beveridge suffered cuts to his head and a wound to the left side of his neck.

Despite the injuries he suffered, the victim managed to get to his feet to tell his attacker "You're going down for murder all over a tenner."

Ms Edwards, the advocate depute, told the court the pair knew each other from the "local drug scene" and the deceased was a known, low level supplier of Valium.

She said telephone messages between the pair suggested Paterson was seeking to purchase Valium tablets "on tick".

When the victim refused they arranged to meet at the scene of the fatal attack to resolve the dispute.

Ms Edwards told the court the content of the texts sent between the two.

She said: "The exchange of text messages provide a flavour of the row between the accused and the deceased over drugs and money.

"In a text timed at 5.50pm, the deceased told the accused that 'Ah don't do tick as they are not mine so if you want to be like that, bring it on, I don't need your business once a fortnight.'

"In response in a message to the deceased at 5.54pm, the accused texted 'meet me now ya p***k I'm puttin' my coat on'."

When they met Paterson was in possession of a knife and struck the deceased around the head, causing two superficial injuries and one penetrating wound to the left side of his neck.

A witness was ultimately able to disarm him and threw the knife on to the pavement.

Medical staff tried to save Mr Beveridge's life but he died the next day.

When police arrested Paterson he told officers the attack was "over a tenner".

Judge Lord Armstrong told Paterson a "substantial custodial sentence" was inevitable when he is sentenced next month.

He said: "You have pleaded guilty to a grave crime. There are no circumstances which can justify the taking of another person's life."

Paterson will be sentenced at the High Court in Glasgow on August 11.