A US woman who sent text messages to her boyfriend, encouraging him to go ahead with a planned suicide attempt, has been convicted of involuntary manslaughter. Conrad Roy killed himself by attaching a gas pump to his car and breathing in lethal carbon monoxide fumes after Michelle Carter's texts pushed him over the edge.

Carter had waived her right to a jury trial and it will be up to the judge to decide what punishment she deserves. She could go to jail for 20 years.

Michelle Carter has been found guilty of involuntary manslaughter in texting suicide trial in Massachusetts. May Conrad Roy III RIP 🙏🏻 pic.twitter.com/0GTn3HfitU — Dylan (@DylansFreshTake) 16 June 2017

​The court in Massachusetts heard Carter, who was 17 at the time, sent dozens of text messages to Roy, 18, as he wavered about taking his own life.

Mr. Roy was found dead in his car in Fairhaven, Massachusetts on July 13, 2014. She was 30 miles away at the time.

The case has set a legal precedent as there is no law in Massachusetts which makes telling a person to commit suicide a crime. But because Carter pleaded guilty, she will have no right to appeal against her sentence, which will be delivered in August.

Some of the details revealed in court sickened people following it on social media.

Michelle Carter texted her suicidal boyfriend: "All you have to do is turn on the generator and you will be free" pic.twitter.com/VS0xxbvMex — Jack Posobiec 🇺🇸 (@JackPosobiec) June 16, 2017​

​It emerged that instead of informing the authorities or trying to warn Mr. Roy's parents, Carter told him he was doing the right thing in killing himself. Part of her motivation, the court heard, was that she was looking forward to playing the role of his grieving girlfriend.

"You need to do it, Conrad" and "All you have to do is turn the generator on and you will be free and happy," were among the texts she sent on the night of his death.

"You're finally going to be happy in heaven. No more pain. It's okay to be scared and it's normal. I mean, you're about to die," she told him.

Police found the text messages when they went through the contents of his cellphone, which was found in his lap.

​Mr. Roy had a history of depression and had considered suicide several times.

While he was on vacation with his family Carter texted him: "Hang yourself, jump off a building, stab yourself I don't know there's a lot of ways."

At one point, as his pick-up truck began filling with fumes, he got out, but she told him to get back inside.

Judge Lawrence Moniz said she was guilty of "wanton and reckless conduct."

Assistant District Attorney Katie Rayburn told the court: "Years ago in order to have a relationship you had to actually see somebody — or at a minimum talk on the phone.

​"That is no longer required. People fall in love via the internet and via text. People bully via text and the internet. You can encourage someone to die via text, and you can commit a crime via text," Rayburn said.

This is Conrad Roy, the victim of Michelle Carter, since the media won't show his picture today pic.twitter.com/2STCLEUquy — Jack Posobiec 🇺🇸 (@JackPosobiec) June 16, 2017​

Carter broke down in tears as the judge read out the verdict but the victim's father, Conrad Roy senior, said: "This has been a very tough time for our family, and we would like to process this verdict that we are happy with."

Mr. Roy's mother, Lynn, said:

"I don't believe she has a conscience. I think she needs to be held responsible for her actions because she knew exactly what she was doing and what she said."

At the sentencing hearing her lawyers are expected to argue that anti-depression medication she was taking at the time affected her judgement.

Legal systems around the world are being forced to catch up with new technology.

Last month a court in Zurich convicted a man of defamation after he "liked" a Facebook post which was anti-Semitic.