Prince George’s County Police Officer Eric Horne sat in the front row of the packed Upper Marlboro courtroom Thursday — wiping tears from his eyes with a crumpled white tissue.

He was there to watch Juan Carter, a disgraced former colleague, learn his punishment for taking guns police had seized and selling them on the streets. One of those weapons got into the hands of a man who shot Horne.

Horne did not speak in court, but in a statement read by a prosecutor he described how thoughts of his pregnant wife flashed through his mind as he exchanged gunfire with a would-be robber while he was off duty in September 2009. Horne, who was shot in the hand, urged Prince George’s Circuit Court Judge Melanie Shaw Geter to remember that he lost a finger in the shooting.

“This officer took the same oath I did and disgraced the uniform,” Horne said in the statement.

In the end, Geter sentenced Carter, 38, to seven years in prison — more than three times the maximum set under state sentencing guidelines, which called for probation to two years in prison. After Carter tearfully apologized, Geter gave the former officer a stern rebuke.

“Mr. Carter, I appreciate your comments to the court today, but I want you to know you have destroyed many families, including your own,” she said.

Carter was indicted in 2010 on charges that he sold or gave away guns seized while he was working on a Maryland State Police gun task force in 2008 and 2009. He was convicted of misconduct and theft at his second trial in January. The first had ended in a mistrial.

Prosecutors argued Thursday that Carter’s misdeeds called for a sentence of 10 years. Unlike other public corruption cases, they said, his misconduct put weapons on the streets.

At least two of the guns were later used in crimes — one to shoot Horne and another to threaten a woman in a domestic violence incident in Baltimore, said Assistant State’s Attorney Jonathon Church. Of the 29 guns that authorities think Carter took, only 12 have been recovered, prosecutors said after the hearing.

“Every time I get a handgun case, I have to stop and think, ‘I wonder if this is one of Juan Carter’s guns?” Church said.

Douglas Wood, Carter’s defense attorney, asked Geter to sentence his client within the guidelines, arguing that Carter had worked honestly as an officer for 15 years. James Carter, Carter's father, also pleaded for leniency.

And Juan Carter fought back tears as he addressed prosecutors directly, saying, “You guys are doing what I didn’t do, which is your job.”

Wood said after the hearing that he was disappointed in the “excessive” sentence and that he planned to appeal the conviction. Police said Carter retired “with prejudice” after his conviction; prosecutors said that allowed him to receive benefits from the police department.

Lt. William Alexander, a Prince George’s County police spokesman, said the Law Enforcement Officers’ Bill of Rights prevented the department from stopping Carter’s resignation so he could not claim benefits, although the “with prejudice” tag would indicate a blemish on Carter’s record if he were to seek another police job.

Horne declined to comment after the hearing. The two would-be robbers involved in his shooting were sentenced in 2010.