TAUNTON, Mass. -- A Massachusetts woman convicted of involuntary manslaughter for urging her boyfriend to commit suicide through a series of text messages was sentenced Thursday.

A judge sentenced Michelle Carter to 2½-years in jail, but ruled she would be eligible for probation after 15 months and suspended the rest of her sentence until 2022. He also sentenced her to five years of probation. Moniz granted a defense motion to stay her sentence, meaning she will not have to go to jail until she exhausts her appeals in Massachusetts. She's now free on supervised release.

Carter's attorney, Joseph Cataldo, told reporters he believes Carter will be cleared.

Get Breaking News Delivered to Your Inbox

WATCH: "48 Hours:" Death by Text

Carter was 17 in July 2014 when she urged 18-year-old Conrad Roy III to "get back in" a truck filled with toxic carbon monoxide gas parked in a Fairhaven parking lot. Juvenile Court Judge Lawrence Moniz convicted Carter in June after a bench trial, saying her final instruction to Roy to get back in the truck caused his death.

Michelle Carter awaits her sentencing in a courtroom in Taunton, Mass., Aug. 3, 2017, for involuntary manslaughter for encouraging Conrad Roy III to kill himself in July 2014. Matt West/The Boston Herald via AP

In dozens of text messages, Carter urged Roy to follow through on his talk of taking his own life.

"The time is right and you are ready ... just do it babe," Carter wrote in a text the day he killed himself.

Prosecutors allege Carter pushed Roy to commit suicide because she was desperate for attention and sympathy from classmates, and wanted to play the role of a grieving girlfriend. Cataldo said Roy was intent on killing himself and took Carter along on his "sad journey." A psychiatrist testified Carter too was "very troubled" and at first tried to talk Roy out of it, but became convinced she needed to help Roy "get to heaven" only after he convinced her there was nothing she could do to stop him.

Cataldo had asked the judge to spare his client any jail time and instead give her five years of probation and require her to receive mental health counseling. He said Carter was struggling with mental health issues of her own -- bulimia, anorexia and depression -- during the time she urged Roy to kill himself.

"Miss Carter will have to live with the consequences of this for the rest of her life," Cataldo said. "This was a horrible circumstance that she completely regrets."

Prosecutor Maryclare Flynn called probation "just not reasonable punishment" for her role in Roy's death. Prosecutors asked the judge for a sentence of 7-12 years.

Moniz repeated a statement by a prosecutor which he called "perhaps the most poignant comment in the trial" -- "This is tragedy for two families."

In handing down his sentence, he cited that Carter was a juvenile at the time of the crime. He said he hasn't found that her age or level of maturity or mental illness had any significant impact on her actions, but said the young age of youthful offenders offers a greater promise of rehabilitation.

Moniz said by the end of today, "people may wonder why all of this has happened." He said he used a compilation of best practices for sentencing juveniles as he came to his decision. He also cited the impact on Roy's family members and took into account their emotional statements to the court.

Carter wiped away tears as she listened to the victim impact statements. Roy's sister Camden Roy said her brother was the "best friend and best role model any little sister could ask for."

"Not having that one person I've been with every day since birth is a pain I'll always keep with me for the rest of my life," Camden Roy said.

Camden Roy testified that she's "haunted" by the realization that she'll never see her brother wed or be an aunt to his children.

Conrad Roy Jr., Roy's father, called his son his "best friend" and "first mate."

"Although he did have some psychological troubles, we all felt he was going in the right direction and over the worst of it," Roy said.

He said Michelle Carter has not shown any remorse and said she "exploited my son's weaknesses and used him as a pawn in her own well-being."

"Where is her humanity? In what world is this behavior okay and acceptable?" Roy said.

A prosecutor read a statement by Roy's mother Lynn Roy.

"There is not one day I do not mourn the loss of my beloved son," the statement read. "I want him to be proud of me and how I am handling everything – I am trying to be there for his sisters in all of my pain we will carry with us for eternity."

In a June interview with "48 Hours," Lynn Roy said she doesn't believe Carter "has a conscience." "48 Hours" investigated the case in the episode, Death by Text.

"I think she needs to be held responsible for her actions 'cause she knew exactly what she was doing and what she said," Roy told Erin Moriarty.

Carter, now 20, was tried as a youthful offender, so Moniz had several options for sentencing. He could have committed her to a Department of Youth Services facility until she turns 21 on Aug. 11. He could also have combined a DYS commitment with an adult sentence, or hand down an adult sentence of anything from probation to the maximum 20-year term.

Carter's family also urged Moniz to consider a term of probation, while Roy's family petitioned the judge to hand her the maximum sentence.

In a letter written to Moniz last month and obtained by the Boston Herald, Carter's father David Carter wrote, "I pray to God you will take into consideration that Michelle was a troubled, vulnerable teenager in an extremely difficult situation and made a tragic mistake."

But in another letter obtained by the Herald, Roy's aunt Kim Bozzi asked Moniz to hand down the maximum sentence – 20 years.

"I'm unsure when [Michelle Carter] decided to set her sick plan into motion or why, but when she did she did it relentlessly, it was calculated and it was planned down to a T," Bozzi wrote, according to the Herald. "She preyed on his vulnerabilities, he trusted her, which in turn, cost him his life."

The sensational trial was closely watched on social media, in part because of the insistent tone of Carter's text messages.

"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," Carter wrote in one text.