A young woman charged with using text messages to encourage her boyfriend to kill himself when they were teenagers sent a text to a friend from high school about two months after the death, saying, "It's my fault," according to testimony at her trial on Wednesday.

Michelle Carter, then 17, cajoled Conrad Roy III, 18, to kill himself in July 2014 with a series of texts and phone calls, prosecutors allege. Roy died when his pickup truck filled with carbon monoxide in a store parking lot in Fairhaven.

"It's my fault," Carter texted to her school friend Samantha Boardman. "I could have stopped him but I told him to get back in the car."

Boardman was among several of Carter's friends and acquaintances who took the witness stand on the second day of the involuntary manslaughter trial in Taunton juvenile court.

Carter's lawyer disputes a crime occurred. Attorney Joseph Cataldo said Roy was depressed, had attempted suicide before, researched suicide methods online and was completely responsible for his own death. He said Carter's text messages are protected free speech.

Carter, now 20, also told Boardman that she feared getting in trouble after she found out that police had Roy's phone.

"I'm done," Carter wrote in one text displayed in the court room. "His family will hate me and I can go to jail."

Two other friends say Carter texted them saying she was on the phone with Roy as he died.

"I was talking on the phone with him when he killed himself ... I heard him die," Carter texted to Olivia Mosolgo days after Roy's death, Mosolgo testified.

Carter also expressed remorse in a message to a friend: "I'm the only one he told things too. I should have gotten him more help," she wrote.

The police detective who conducted the criminal investigation also testified. Fairhaven Detective Scott Gordon said he found Roy's phone and discovered the text conversation between Roy and Carter.

The case is being tried without a jury, and a judge will deliver the verdict. The judge visited the site where Roy's truck was found on Wednesday afternoon.