A man accused of murdering a woman told police that he had visited the block of flats where she lived to buy crack cocaine.
But Norman Duncan maintained to detectives during an interview that he was not responsible for the murder of Margaret Robertson.
Duncan, 42, agreed that he was at Promenade Court, in Aberdeen, three times on September 25 in 2019.
He said that he twice purchased crack for £20 each time, but did not get the drug during a third visit. He told detectives: “Twice I got it. Three times I was there.”
Duncan was asked whether he took any other drugs when using crack and replied: “I just take crack.” He said the drug made him feel “elated” and “happy”.
It was put to him during an interview, which was recorded and played to jurors at the High Court in Edinburgh, that he was responsible for the murder, but replied: “It wasn’t me.”
Duncan has denied assaulting and murdering Margaret Robertson or Fullerton, 54, known as Meg, at 45 Promenade Court on September 25 in 2019.
Prosecutors claim he seized hold of her, pulled her, struggled with her and sexually assaulted her before stabbing her repeatedly on the head, neck and body.
He is also accused of attempting to defeat the ends of justice between September 25 and October 1 in 2019 at the flat in Promenade Court, at addresses in Seaton Walk and Northsea Court, in Aberdeen, and elsewhere.
It is alleged that he changed out of bloodstained clothing and trainers and washed them, washed or discarded a bloodstained knife or sharp instrument, hid from police officers and provided false personal details.
Duncan is also alleged to have been in possession of the Class A drug cocaine at 45 Promenade Court on September 25 in 2019.
He has lodged a special defence of incrimination to the murder charge.
DC Paul Tully, 43, said that on October 1 in 2019 he had attended at an address in Seaton Walk where two uniformed constables were with Duncan.
He said that Duncan was advised he was being arrested on suspicion of murder.
Duncan was noticed to be drowsy and gave information about medication.
The detective said he was taken to a police station at Kittybrewster, in Aberdeen, but was “dozing off” during the drive.
A decision was made to take him to Aberdeen Royal Infirmary to be checked over. He was interviewed later.
Duncan denies all charges.
The trial before judge Lady Scott continues.