Former Prince George's County police officer Juan Carter was sentenced to prison Thursday for selling guns police had seized from criminals.

Carter, 38, was sentenced to 20 years in prison with all but seven years suspended. He had been convicted of theft and misconduct in office charges in January.

Carter had been responsible for logging in guns seized by a Maryland State Police task force. But between August 2008 and October 2009, 29 confiscated guns were never listed on the police property log, prosecutors said. Authorities recovered about a dozen of the stolen weapons so far and are looking for the rest.

One of the guns that Carter took and sold was later used during a domestic dispute in Baltimore, prosecutors said. Another was used in the shooting of an off-duty Prince George's County police officer, Eric Horne, who lost one of his fingers in the incident.

During Thursday's sentencing in Prince George's County Circuit Court, a prosecutor read a letter from the wounded officer. Horne wrote that when he learned about the history of the gun that had wounded him, "the feeling of hurt was the one I felt most of all."

Prosecutors noted that the unrecovered guns Carter took and sold could still be used to commit additional crimes. But defense lawyer Douglas Wood said that Carter was a good police officer prior to the offenses.

"For all these years, he was a fine man," Wood said.

Carter's father suffered a stroke on the day his son was convicted and asked that the judge "show some humanity" so that Carter could help him.

Addressing the court during Thursday's hearing, Carter apologized to Prince George's County police for any damage he caused to the department's reputation. He also apologized to his family.

"I'd like to say I'm sorry," he said.

Judge Melanie Shaw Geter said the saddest part of the case is that "the defendant is an individual who took an oath to protect the community."

Sentencing guidelines require Carter to serve no more than two years behind bars. But Geter said she was giving Carter a longer sentence because "we have to take a stand against gun violence."

Carter resigned from the Prince George's County Police Department shortly after he was convicted, according to a police spokesman.