The crime became international news by virtue of its comedic value: A burglar was caught after he left his cellphone — plugged into a wall because it needed charging — behind at the scene of a Silver Spring break-in, leading police right to him.

But there was little comedy in court Thursday. Seven victims testified about lives changed. The parents and grandmother of the burglar spoke of the heartbreak of his pain-pill addiction. And a judge hammered down a 26 ½-year prison sentence for Cody Wilkins, who had pleaded guilty to seven break-ins, all in Montgomery County.

“You left behind a trail of victims, and these are the ones we know about,” Circuit Court Judge Eric M. Johnson told Wilkins, adding that he had “wreaked havoc” in their lives by taking items of monetary and deep sentimental value.

Police suspected Wilkins in dozens of break-ins between fall and January. Johnson said he handed down the sentence — unusually long for someone who hadn’t robbed, injured or killed anyone — because Wilkins hit so many houses and left victims feeling so violated.

In Maryland, defendants can ask judges to reconsider their sentences. The judge left open the idea that he might reduce the sentence later. As the sentence stands, Wilkins would be eligible for parole after serving half the time.

Wilkins, 25, broke into homes to feed a $300 daily oxycodone habit, said his attorney, David Martella. On Jan. 28, he had no power at his home because of an area outage, so he took his cellphone on a burglary job to try to charge it, according to police. He left the phone plugged into a wall before jumping out a second-floor window when a resident came home, police said. In court Thursday, Wilkins stood to speak, wearing a white shirt and dark tie.

He spoke of the pain he caused his family. He offered no excuses, apologized to the victims and told Johnson that he wanted to repay them. Prosecutor Marybeth Ayres estimated the total in lost items and cash after insurance — just for the seven victims in court — at $74,252.67.

“Let me get back to work so I can repay that,” Wilkins said.

But the testimony of the seven victims called to the witness stand worked against him. Perhaps most compelling was Judy Rantovich, who used a cane to walk to the front of the courtroom.

Instead of sitting in the witness seat, she stood, leaning on her cane with two clasped hands. Facing Johnson, she introduced herself as a 79-year-old widow. Wilkins broke into her home in Silver Spring four days before Christmas.

“He took my wedding ring and my engagement ring,” Rantovich said. “He took my mother’s wedding ring.”

Her husband, Stephen, died four days before they were to celebrate their 45th wedding anniversary, she said. After his death, she saved his wedding ring, which Wilkins took. She also kept his wallet and the four $50 bills he had kept inside. Wilkins took the bills, Rantovich said in court, along with $3,000 in cash.

Since then, Rantovich has put in an alarm system. But whenever she arrives home, she told Johnson, she goes from room to room, checking to see if someone has broken in. “It’s terrible to live in fear,” she said.

Like other victims who spoke, Rantovich had kind words for Wilkins’s parents, who had spoken movingly about their son and the havoc his addiction had wrought on their lives. ”I pray for his parents,” Rantovich said, “because they must be going through torture.”

His parents, Fiorella and Keith Wilkins, left a positive impression on nearly everyone in the courtroom. They told Johnson that their son was an honor student and athlete through middle school. In high school, he became withdrawn and then spent years living in and out of their home. By 2009, he had become a drug addict. “Cody disappeared from our lives,” Fiorella Wilkins said.

For 15 months, they didn’t hear from him. She said that when she heard news reports of a young person’s death, she always worried it was her son. When he ended up in Maryland and under arrest, they were relieved: He was still alive.

Staff researcher Jennifer Jenkins contributed to this report.