As the trial began in Taunton on Tuesday, Maryclare Flynn, a prosecutor, told Judge Lawrence Moniz that Ms. Carter essentially caused Mr. Roy’s suicide, pointing repeatedly to text messages that seemed to urge Mr. Roy to take his life.

“Just park your car and sit there and it will take, like, 20 minutes,” Ms. Carter wrote. “It’s not a big deal.”

It did not stop with text messages, Ms. Flynn said. With the suicide plan in motion, Mr. Roy at one point got out of the car, apparently feeling fear, the prosecutor said. But in a phone call, Ms. Carter “ordered him back in and then listened for 20 minutes as he cried in pain, took his last breath, and then died,” Ms. Flynn said.

Prosecutors say Ms. Carter was driven by a hunger for attention from her peers in Plainville, Mass. She got attention when she talked about her suicidal boyfriend, Ms. Flynn said, and risked that her peers would think she was lying if he did not follow through. “She used Conrad as a pawn in her sick game of life and death,” Ms. Flynn said.

But Ms. Carter’s defense lawyer portrayed Mr. Roy as a depressed teenager who had attempted suicide before, planned his death and chose to end his life on his own. Joseph P. Cataldo, the lawyer, said that Mr. Roy had done hundreds of online searches relating to suicide and that Ms. Carter had, at earlier points, suggested that Mr. Roy seek help.

“This is a suicide case,” Mr. Cataldo said. “It is not a homicide.”

Mr. Cataldo emphasized Mr. Roy’s mental health problems and said he had faced abusive treatment from family members. He described Ms. Carter as a vulnerable teenager, too, saying she had suffered from an eating disorder, had been treated in a psychiatric hospital and was impaired by the side effects of an antidepressant.

“She was dragged into this,” Mr. Cataldo said, adding, “There was no infliction of harm by Michelle Carter, who was 30 miles away.”