William Lowry walks alongside his son, former FBI agent Matthew Lowry, as he arrives for Thursday’s sentencing hearing. (Nikki Kahn/The Washington Post)

A onetime FBI agent who fed his drug addiction by stealing heroin seized as evidence in criminal cases was sentenced Thursday to three years in federal prison, a punishment far less than prosecutors and other law enforcement authorities sought.

U.S. District Judge Thomas F. Hogan rejected Matthew Lowry’s plea for home detention, noting that the misconduct tainted investigations and forced prosecutors to dismiss cases against 28 drug defendants, 25 of whom had pleaded guilty and were freed from incarceration.

But the judge called Lowry’s addiction a mitigating factor that justified departing from sentencing guidelines that recommended a sentence of seven to nine years. Hogan noted that Lowry took heroin not “to play around” but after he had become dependent on prescription pain medication used to treat a painful intestinal inflammation.

“What we have here is a successful young agent with a sterling reputation who abused his position and abused his trust,” said Hogan, describing the decision as the most difficult in his 32 years on the bench. He added, however, that because of Lowry’s actions, “major drug dealers were put back on the street to harm our citizens and endanger our children.”

A look at how Agent Lowry affected the case of Earl Owens, who was eventually dismissed.

The U.S. attorney’s office and Special Agent Andrew G. McCabe, head of the FBI’s Washington field office, urged Hogan to impose the full term under the guidelines. In a letter to the court, McCabe called “the full extent of the damage incalculable.”

Lowry, 33, will have to report to the Bureau of Federal Prisons once authorities determine an appropriate facility. He pleaded guilty in March to 64 criminal charges, including obstruction of justice, tampering with evidence and heroin possession. He was fired from the FBI as a condition of his plea.

Thursday’s three-hour hearing, packed with Lowry’s relatives, friends and pastor, concludes the criminal case that began in late September, when the agent was found incoherent next to his unmarked police car in an empty lot near Washington’s Navy Yard.

It was then that fellow agents, cleaning out the car, found opened packages of heroin that were evidence in some of the Washington region’s biggest drug investigations and Lowry’s addiction came to light. The case also exposed weak rules in the handling of evidence at the FBI’s Washington field office, in which drugs signed out for lab testing weren’t tracked. Lowry developed an intricate scheme that included carefully using filler after stealing heroin so the evidence bags would maintain their recorded weight and forging colleagues’ names on evidence slips and evidence tags.

During Thursday’s hearing, Hogan asked prosecutors how Lowry could hold onto drug evidence and store it in his car for so long without being detected. Assistant U.S. Attorney Kevin R. Brenner answered simply that Lowry had “perpetrated a coverup.”

Since pleading guilty and completing a drug treatment program, Lowry has embarked on a unique public-relations campaign, partly as part of a plan to secure a lighter sentence but also to warn about the ease of becoming addicted to prescription medication and how that can lead to heroin abuse.

A photograph from FBI evidence files of the Chevrolet Impala in which heroin and other evidence was found. The car had been assigned to FBI special agent Matthew Lowry. (U.S. District Court)

His attorney, Robert C. Bonsib, asked his client’s supporters to stand in the public gallery. They included his father, mother, in-laws, two brothers and 11 friends. Several addressed the court and pleaded for leniency, telling Hogan that a prison term would not benefit society. The judge remarked out loud whether departing from sentencing guidelines could be construed as giving favorable treatment to a defendant with a substantial family network, money and access to the region’s best treatment centers.

Lowry’s father, William, a retired police official who served as an assistant chief in Anne Arundel County, recounted his son’s long adoration and reverence for police and the horrors of missing the signs of his son’s addiction. Matthew Lowry was using heroin even as he, his wife and newborn child lived with his parents while waiting for their $1 million house to be built.

The elder Lowry told the judge that he taught his three sons to be strong, to not ask for help from others. “I find that in my old age, that is not good advice. I apologize.”

Lowry’s wife, Shana, told Hogan that she had tried to prepare remarks but couldn’t get them out. Choking back tears, she said she knew something was wrong because of her husband’s unusual demeanor and exhaustion. “I tried to get him help,” she said, adding later, “I was proud of him then, and I’m proud of him now.”

When Lowry stood before the judge, his father leaned as far forward on a gallery bench as he could, focusing on every one of his son’s words. His son’s wife sobbed as her husband apologized to her, the rest of his family, the prosecutors and his fellow agents whose hard work on drug cases he had undermined.

“I’m an addict,” Lowry told the court. “I’ll be an addict the rest of my life.”

Bonsib said that sentencing guidelines did not fit this unique case, and he urged the judge to ignore them. He also questioned prosecutors for dismissing so many criminal cases, saying that many could have gone forward with other evidence not tainted by his client. Bonsib called Lowry’s theft of heroin “a disruption of the process, not a disruption of the cases.” He urged Hogan to allow Lowry home detention, saying his client “could not help himself, but he can help others. . . . Send him into the community with a message.”

But prosecutors said that Lowry had shrewdly sabotaged criminal cases even as he worked to investigate them and that he knew tampering with evidence would endanger convictions. They said that Lowry played a crucial role in every case that was dismissed, including searching a stash house and seizing drugs used to convict 14 defendants, drugs he later stored in his car to feed his habit.

“The chain of custody ran right through Lowry’s vehicle,” Assistant U.S. Attorney Jonathan M. Malis, chief of the District’s criminal division, said in court. Added Brenner: “Serious crimes deserve serious punishment.”