In opening statements, Tom O’Brien, the federal prosecutor, said Ms. Drew had “hatched a plan in order to prey on the psyche of a vulnerable 13-year-old.” The goal, Mr. O’Brien said, was “to embarrass her, to humiliate her, to make fun of her and to hurt her.” Ms. Drew knew of Megan’s history of depression and attention-deficit disorder, he said, because Ms. Drew had given Megan her medicine when she vacationed with the Drew family.

Ms. Drew’s lawyer argued that she was not at home when the fateful message was sent, and that while she knew about the account, she did not play an active role in sending messages to Megan. He argued that those messages were written by an employee of Ms. Drew’s and other young girls, and that Ms. Drew would not have understood how to set up a fake account.

Christina Meier, Megan’s mother, testified calmly abut the messages and said she had once alerted the police when she felt they had become sexual.

“There are two sides to every story,” said Dean Steward, Ms. Drew’s lawyer, who depicted Megan as a fickle friend who had taunted Sarah Drew by spreading “horrible” rumors about her. Mr. Steward implored jurors to remember that “this is a computer abuse and fraud case, not a homicide case.”

Judge George H. Wu instructed jurors before opening arguments that Megan’s suicide would be “the subject of some testimony” that could be relevant to their conclusions but that Ms. Drew was not charged with having anything to do with Megan’s death.

Ms. Steward’s contention that Ms. Drew had had no role in setting up the account was called into question by the first witness, Susan Prouty, who manages an interior design shop and did business with Ms. Drew, who runs a magazine coupon business. Ms. Prouty testified that Ms. Drew had said “she created the account” and had intended to print out a thread of flirtatious messages to take to Megan’s school to “humiliate her.”

Ms. Prouty testified that Ms. Drew told her daughter Sarah what to type, “and had even typed some herself.” Ms. Prouty said that Ms. Drew, upset with Megan’s behavior toward Sarah, had told her, “As a mother you have to protect your daughter.”