A murder accused said he "didn't feel worthy to be on earth" before he killed a postwoman, a court has heard.
Emily French, 21, was giving evidence at the trial of Nicholas Rogers, 27, at the High Court in Glasgow.
She described how she spoke to Mr Rogers for over an hour and how he had talked about taking his own life.
He denies murdering Alexandra Stuart, 22, in Peebles but admits killing her, claiming he was suffering from an "abnormality of the mind" at the time.
The court heard Ms French was at a house with Nicholas Rogers and Alex Stuart on the day in August 2017.
Advocate depute Keith Stewart QC asked Ms French what they had been talking about.
She said: "He said he was upset about himself, he said he didn't feel worthy to be on earth.
"He said he would like to kill himself.
"He was upset and distressed, he was talking about his childhood and his depression.
"He was wanting to show me messages on his phone from his mum."
She added that she had not seen the messages but Mr Rogers told her what his parents were like.
'Calm him down'
The court heard he told Ms French he had been in Huntlyburn - a unit for people with mental health problems - and said he didn't want to go back but still felt depressed.
She said: "I was trying to help him and calm him down, I kept saying tomorrow is another day."
Defence QC Brian McConnachie asked if Mr Rogers told her he had taken an overdose a week earlier and none of his family went to visit him and she said that he had.
However, she said she couldn't remember being told he had been diagnosed as bipolar.
She said: "I was saying there's a whole world out there you can do what you want with your life."
The trial before judge Lord Summers continues.