In an "evil scheme," a Massachusetts mother fabricated symptoms of mental illness to get her 4-year-old daughter powerful drugs, then overmedicated the girl and allowed her to die when she became ill with pneumonia, a prosecutor said Tuesday at the woman's murder trial.

Assistant District Attorney Frank Middleton said Carolyn Riley took her daughter, Rebecca, to a psychiatrist when she was 28 months old in hopes of getting her diagnosed with mental illness and put on drugs so she and her husband could collect Social Security disability payments for the girl.

Middleton said Carolyn Riley consistently overmedicated the girl, giving her more than the amount prescribed by a psychiatrist. Then, when the girl became ill with pneumonia in the final days of her life, Carolyn Riley ignored the urgent pleas of three people who lived with them and refused to take her daughter to a doctor. Instead, Middleton said, she gave her daughter almost twice the amount of drugs prescribed by the psychiatrist.

"This defendant began an evil scheme that ended in murder," Middleton said.

Riley and her husband, Michael, are both accused of murder in their daughter's December 2006 death in Hull. Michael Riley will go on trial after his wife.

Carolyn Riley's attorney, Victoria Bonilla, said Carolyn took Rebecca to a psychiatrist when she was 2 because she was concerned about the girl, who was very active and had difficulty sleeping.

She said Carolyn Riley followed the instructions of the psychiatrist, Dr. Kayoko Kifuji, who diagnosed attention deficit hyperactivity disorder when the girl was 2 and bipolar disorder shortly after she turned 3. It was Dr. Kifuji, Bonilla said, who prescribed Clonidine for the ADHD and Depakote for bipolar disorder.

"This is not nefarious," Bonilla said, but consistent with common medical practice to treat ADHD with Clonidine.

Bonilla also disputed allegations made by prosecutors that Carolyn Riley ignored pleas to help her daughter after she became ill with pneumonia. She said Carolyn Riley bought her daughter some children's cold medicine and gave it to her.

"Carolyn Riley did everything she could to treat her child. Carolyn Riley thought her daughter had a cold," she said.

Bonilla said a defense medical expert, as well as a prosecution expert, came to the conclusion that Rebecca died of pneumonia, not a drug overdose.

"She did not die at the hands of her mother," Bonilla said.

Middleton, however, said that in the last year of her life, Rebecca Riley was given well over the amount of Clonidine prescribed by Kifuji.

Middleton used a gruesome photo of Rebecca in his opening statement to the jury.

The photo, taken by police after her mother found her dead on the floor of their bedroom, shows the little girl wearing only a pink pull-up diaper, lying on a pile of magazines and clothing and a stuffed bear. She has a pink liquid oozing from her nose and mouth.

Carolyn Riley showed little emotion after her daughter was found dead, he said. Later that day, he said, when Carolyn and Michael Riley went to get their daughter's things at her school, the principal saw them "joking and laughing" outside the school.

But Bonilla said Carolyn Riley was a "loving and caring parent," called distraught by emergency responders after she found her daughter dead on the floor near her bed.

"She was cradling the child. She was hysterical," Bonilla said.

Click here for more from MyFoxBoston.com.