FILE - In this Aug. 24, 2015, file photo, Michelle Carter listens to defense attorney Joseph P. Cataldo argue for an involuntary manslaughter charge against her to be dismissed at Juvenile Court in New Bedford, Mass. Carter, a teenager from Plainville, Mass., is charged with involuntary manslaughter in the 2014 death of Conrad Roy III. The Massachusetts Supreme Judicial Court ruled Friday, July 1, 2016, Carter must stand trial on a manslaughter charge for encouraging Roy to kill himself by sending him dozens of text messages and telling him to "get back in" a truck filled with carbon monoxide fumes. (Peter Pereira/Standard Times via AP, Pool, File) MANDATORY CREDIT FILE - In this Aug. 24, 2015, file photo, Michelle Carter listens to defense attorney Joseph P. Cataldo argue for an involuntary manslaughter charge against her to be dismissed at Juvenile Court in New Bedford, Mass. Carter, a teenager from Plainville, Mass., is charged with involuntary manslaughter in the 2014 death of Conrad Roy III. The Massachusetts Supreme Judicial Court ruled Friday, July 1, 2016, Carter must stand trial on a manslaughter charge for encouraging Roy to kill himself by sending him dozens of text messages and telling him to "get back in" a truck filled with carbon monoxide fumes. (Peter Pereira/Standard Times via AP, Pool, File) MANDATORY CREDIT

BOSTON (AP) — A teenager who sent her boyfriend dozens of text messages encouraging him to take his own life and told him to “get back in” a truck filled with carbon monoxide fumes must stand trial for involuntary manslaughter, the state’s highest court ruled Friday.

The Supreme Judicial Court ruled Friday that a grand jury had probable cause to indict Michelle Carter, then 17, in the 2014 death of Carter Roy III, 18.

Carter’s lawyer had argued that her texts were free speech protected by the First Amendment and didn’t cause Roy to kill himself.

But the court, in a strongly worded decision, said the grand jury heard evidence suggesting that Carter engaged in a “systematic campaign of coercion” that targeted Roy’s insecurities and that her instruction to “get back in” his truck in the final moments of his life was a “direct, causal link” to his death.

“In sum, we conclude that there was probable cause to show that the coercive quality of the defendant’s verbal conduct overwhelmed whatever willpower the eighteen year old victim had to cope with his depression, and that but for the defendant’s admonishments, pressure, and instructions, the victim would not have gotten back into the truck and poisoned himself to death,” Justice Robert Cordy wrote for the court in the unanimous ruling.

The case drew national attention after transcripts of text messages Carter sent to Roy were released publicly, showing her urging him to follow through on his plan to kill himself and chastising him when he expressed doubts.

“I thought you wanted to do this. The time is right and you’re ready, you just need to do it!” Carter wrote in one message.

“You can’t think about it. You just have to do it. You said you were gonna do it. Like I don’t get why you aren’t,” she wrote in another message.

The teens had met in Florida two years earlier while visiting relatives. Their relationship largely consisted of text messages and emails. They hadn’t seen each other in more than a year when Roy died, even though they lived only about 50 miles apart in Massachusetts, Carter in Plainville, and Roy in Mattapoisett.

Roy’s grandmother Janice Roy said the family is happy Carter can be put on trial.

“He was very vulnerable at that stage,” she said.

Carter’s lawyer, Joseph Cataldo, argued that Roy was a depressed teenager who had previously tried to take his own life and was determined to finish the job this time. He also argued that Carter shouldn’t have been charged with manslaughter because Massachusetts doesn’t have a law against encouraging or assisting suicide.

On Friday, Cataldo said he was surprised and disappointed by the court’s ruling. But he noted that the court didn’t weigh in on Carter’s guilt or innocence, but merely found there was enough evidence for the case to proceed to trial.

“At trial, it’s proof beyond a reasonable doubt, which is a much higher standard, and I’m confident that ultimately, after trial, Michelle Carter will be acquitted,” he said.

In addition to the text messages, prosecutors focused on a phone conversation Carter had with Roy while he was in his truck inhaling carbon monoxide fumes. Prosecutors said Carter sent a text to one of her friends after Roy’s death and told her that while she was on the phone with Roy, he got out of his truck because he became frightened. She said she told him to “get back in.”

Gregg Miliote, a spokesman for Bristol District Attorney Thomas Quinn III, said prosecutors appreciate the court’s decision to uphold a lower court’s denial of Carter’s motion to dismiss the charge against her. They now will focus on preparing for trial, he said.