Media playback is unsupported on your device Media caption How text messages led to a suicide

A Massachusetts judge has ruled that a woman who sent dozens of texts encouraging her boyfriend to commit suicide is guilty of his death.

Michelle Carter, now 20, was convicted of involuntary manslaughter for her messages to 18-year-old Conrad Roy urging him to kill himself.

He took his own life on 13 July 2014 by running a generator in his vehicle in a car park in Fairhaven, Massachusetts.

Carter, who could face up to 20 years in prison, sobbed in court.

She encouraged her boyfriend to take his own life so she could seek attention as the "grieving girlfriend", the trial heard.

The case appears to set a legal precedent, as there is no Massachusetts law that criminalises telling a person to commit suicide.

Judge Lawrence Moniz said Ms Carter was guilty of "wanton and reckless conduct" by sending Mr Roy a message instructing him to get back in the truck, which he had exited as it filled with fumes.

"She called no one and finally she did not issue a simple additional instruction - get out of the truck," he said.

Image copyright Facebook Image caption Carter reportedly texted Mr Roy that his parents would "get over" his suicide

The accused broke down in tears as the judge delivered his verdict.

The victim's father, also called Conrad Roy, said in a press conference the family was "thankful" for the verdict.

"This has been a very tough time for our family, and we would like to process this verdict that we are happy with," he said outside court.

Carter has been allowed by the judge to remain free on bail, pending sentencing, but is banned from sending text messages or using any social media network.

The criminal charge against Carter meant that prosecutors had to prove that she had a "direct" role in Mr Roy's death.

Where to get help

If you are depressed and need to ask for help, there's advice on who to contact at BBC Advice.

From Canada or US: If you're in an emergency, please call 911. If you or someone you know is suffering with mental-health issues, call Kids Help Phone at 1-800-668-6868. If you're in the US, you can text HOME to 741741

From UK: Call Samaritans on 116123 or Childline on 0800 1111

Judge Moniz, who handed down the ruling because Carter chose not to have a jury trial, said the fact that Mr Roy had previously attempted to take his own life, or that he might have done so again, was not relevant.

Assistant District Attorney Katie Rayburn told the court in her closing arguments that the directness required by the involuntary manslaughter statute required updating for the modern age.

"Back 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," she said.

The case drew national attention after the texts sent between the two teenagers were revealed by investigators.

"Hang yourself, jump off a building, stab yourself I don't know there's a lot of ways," she said in several messages sent in the two weeks before his death, as he was on holiday with his family.

In the moments before his suicide, she wrote: "You need to do it, Conrad" and "All you have to do is turn the generator on and you will be free and happy."

Image copyright WCVB Image caption Mr Roy had been due to attend university in the autumn

In another message, she wrote: "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."

Prosecutors argued that Carter had manipulated Mr Roy, who had a history of depression and suicide attempts, into taking his own life, advising him that it would be "painless".

But Carter's defence team argued that Mr Roy had planned his own suicide, and had gone so far as to secure the equipment that he used to take his own life.

They also said anti-depression medication that Carter was taking had affected her judgment.

As Mr Conrad's truck filled with poisonous carbon monoxide, he left his vehicle to speak on the phone, with Carter, who was nearly 30 miles (48km) away at the time.

Investigators did not have a recording of that call, but in a text to a friend, Carter described what was said.

"Sam, [the victim's] death is my fault like honestly I could have stopped him I was on the phone with him and he got out of the [truck] because it was working and he got scared and I [expletive] told him to get back in Sam because I knew he would do it all over again the next day and I couldnt have him live the way he was living anymore I couldnt do it I wouldnt let him," she wrote after his death.

Another message to her friend stated: "I was on the phone talking to him when he killed himself. I heard him dying."

She also contacted a friend when she learned that investigators were looking through Mr Roy's phone.

"They read my text messages to him I'm done", the accused wrote, adding, "his family will hate me and I could go to jail".

She will be sentenced on 3 August 2017.