A 62-year-old Main Line woman who sold heroin out of her home, near an elementary school, to undercover police officers last year was sentenced Friday to 90 days in prison and seven years' probation, almost a year of which she will spend on house arrest.

A judge accepted Lynne C. Twaddle of the Wayne section of Tredyffrin Township into Recovery Court on Friday at a hearing at the Chester County Justice Center.

"You were admitted because you have a problem," Judge Phyllis R. Streitel said, telling her to "embrace this opportunity."

Streitel said she believed Twaddle could succeed and asked her if she agreed.

"Yes," Twaddle responded emphatically.

She pleaded guilty in August to three counts of possession with intent to deliver heroin for selling 22 baggies of the drug to a police informant in Tredyffrin and Phoenixville Borough. She admitted that during a police search of her house, officers found 67 baggies of heroin, or about four grams, some of which was for personal use.

Twaddle's lawyer said she only sold heroin to a friend of hers, who turned out to be the informant.

Twaddle will receive credit for the 32 days she has already served in prison. After her release, she will enter an in-patient drug treatment program, followed by a stay in a halfway house before going home.

Police arrested Twaddle in July 2015 after a four-month of investigation and charged her with drug possession, possession with intent to deliver and related offenses.

Her attorney, John I. McMahon Jr., said the "tragedy of this matter" is that she first became addicted to narcotics that doctors prescribed after she had two hip surgeries last year. She then moved to heroin. After her arrest, she also had a spinal-fusion surgery.

Twaddle wore a back brace as she stood before the judge Friday and thanked her for admitting her into the drug recovery program.

McMahon said she "had overcome alcoholism" in the past.

She was convicted in 2004 and 2007 of driving under the influence, in 2005 of possession of a controlled substance and in 2011 of possession of drug paraphernalia.

"She has a lot of support from her husband and family," McMahon said.

She has lived with her husband in their home in the 400 block of Pugh Road for the last two decades. Her house is about 150 feet from the access road that leads to New Eagle Elementary School.

After police received a tip, officers began investigating Twaddle, according to Tredyffrin Township police. Undercover officers bought the drug from her on at least four occasions, police said.