A murder accused has admitted he was with small-time drug dealer Duncan Banks in his Dunfermline home less than two hours before he was killed.

Steven Thomson insisted he was not the killer, although he was one of a “select few” who were allowed access to Duncan’s first floor flat.

Giving evidence in his own defence at the High Court in Livingston, Thomson said he had left Duncan’s council home in Skye Road at 9.30 am on Sunday 27 September 2015 after they took heroin together.

Police experts estimate that Duncan was murdered between 9.30am and 11.30am that day, 24 hours before he was found dead in his armchair with horrific head injuries, inflicted with a blunt instrument thought to be a claw hammer.

Derek Ogg QC, defending, asked Thomson directly: “Did you persuade Duncan to let you into the house with a pre-planned idea to harm him or to come by some easy money?” He replied: “No.”

He insisted that the large amount of money he had in his wallet at around 11am that Sunday morning – captured on CCTV in a local shop – was the proceeds of his own drug dealing, not cash stolen from Duncan.

He confirmed that the shopkeeper had commented: ‘Is it payday or something?’ He told the jury: “I said no, I’d been at the bookies, or something like that, because I wasn’t going to expose where it came frae: from selling heroin.”

He said he was sure he had £200 in notes and said he’d had plenty of opportunities to steal from Duncan when he stayed over at his flat earlier that week.

Under cross examination, Thomson accepted that his 10 year addiction to hard drugs meant he’d “do pretty much anything” to get a fix of heroin.

He agreed he’d deceived his mum, his partner and pretty much everyone around him to hide his “pernicious” addiction.

Advocate depute Alex Prentice, prosecuting, said to him: "Your answer to murder is that Duncan Burns was a close trusted friend with whom you occasionally shared heroin; that you went to his home on 27 September 2015 and took heroin in his presence; that you left him and he was fine, and that you didn’t attack him in any way.” He said: “That’s right.”

Mr Prentice said: “You were there at 9.30 am. You saw him alive. You left him. That was crucial information for the police and you were in hiding.”

Thomson said: “That’s right, yeah.”

He was asked: “And you knew Duncan had drugs that weekend; David Docherty’s drugs?”

“I did yeah," he replied. 

“And an idea of how much money he expected to collect?” Mr Prentice asked. 

“Depends on how much gear he had," Thomson said.

"How would I ken unless I knew how much heroin he had. I don’t know how much Davie left with him.”

Mr Prentice put to him: “If you cared for helping the inquiry into the death there was nothing to stop you going to the police and saying: ‘I saw him yesterday. He was fine at the time’.

Thomson answered: “If I went to the police station I’d have been kept on my warrants regardless.”

He admitted that he knew there was a hiding place for drugs and cash under the floorboards in Duncan’s bedroom and that he knew Duncan was selling heroin that weekend.

Mr Prentice asked him: “Where’s your claw hammer?”

Thomson replied: “The claw hammer that was referred to in the shed was an old hammer left by the person before. That last time any of us saw it was well before any of this.”

Asked where was it when he last saw it he replied: “In the shed.”

Mr Prentice said: “Where is it now?”

Thomson replied: “I don’t know.”

He rebutted claims by witnesses Andrew Gillies – who gave evidence about him saying he was planning to rob Duncan – and Liam McIlduff – who testified that he had confessed to the murder in prison – saying they were: “simply liars”.

Mr Prentice asked him: “Did you take it – such was your craving for heroin you’d pick a soft target – attack Duncan, murder him and take money and heroin?”

He replied: “No.”

Mr Prentice continued: “The truth is you went to Duncan Banks; your craving was such that you had to get money and heroin; this addiction took over, and you killed your best friend.”

“I didn’t," Thomson said.

Defence witness Aaron Donald, 26, a prisoner at HMP Perth, said he had shared a cell with Liam McIlduff in the prison when they were both on remand in December 2015.

He claimed McIlduff had spoken to him about a £10,000 reward for information about a murder that had happened in Dunfermline.

Mr Donald said: “He went on to say that if we were to say someone in that hall did it and if we were to give the same statement to the police it’s two against one and the police would believe us rather than that person and we’d get a 10k reward.

“I asked him 'Would you really let an innocent person go to prison for £5,000 each?'. He said: ‘They’ll no be able to get to us, anybody, because they’ll be in the jail’.

“I said to him: ‘Are you being serious?’ He said he was.”

The trial, before Lady Rae, continues.