The two youths who received the guns worked for a private security firm that former officers Danny Harris Jr., 32, of Pinole, and Raymond Thomas Jr., 34, of Fairfield, operated from 2008 to 2010.
Harris and Thomas, who were then members of the Richmond police force, called their firm the Strategic Security Reliance Group.
Both pleaded guilty before U.S. District Judge Claudia Wilken in March to a charge of conspiring to obstruct a federal investigation into the illegal purchase of the guns for their employees.
Harris also pleaded guilty to two counts of making false statements on federal forms when he bought handguns from a San Jose dealer in 2009 for security employees Sergio Rios and Orlando Torres, who were then aged 19 and 20, and claimed the guns were for himself.
Wilken on Tuesday sentenced Harris to six months in a halfway house, followed by six months of home detention. She also ordered him to spend five years on probation and perform 250 hours of community service.
The judge sentenced Thomas to six months of home detention plus three years of probation and 250 hours of community service.
Harris had recruited Rios and Torres from the Police Department's Explorers Program, which Harris helped to run. The program provides community service opportunities and a chance to learn about police work to young people between the ages of 14 and 20.
Although it was illegal for anyone under 21 to buy handguns from a federally licensed dealer, it was not illegal for Rios and Torres to work as state-licensed security guards or to possess a gun while on the job when they were between the ages of 18 and 21.
The security firm had a company gun the employees could use, but Rios and Torres informed investigators they had told Harris they had problems because the company gun wasn't always available when they were offered work, according to prosecutors.
Prosecutors said in a sentencing brief that as part of the obstruction conspiracy, Harris and Thomas hired former private investigator Christopher Butler to help them retrieve Rios's handgun in 2010, after they realized that a probe was under way.
Prosecutors said the plan was that a woman hired by Butler would lure Rios into a compromising situation in which he would be pulled over for driving under the influence and found in possession of the gun.
The Butler employee met Rios at his job as a movie theater security guard, flirted with him by text messages and on a date, and was in the process of arranging to have him meet her with his gun.
But the scheme was cut short, according to the prosecutors' brief, when another Butler employee who felt bad about the set-up sent Rios an anonymous warning on Facebook. Rios then broke off contact with the woman.
Prosecutors said another part of the obstruction conspiracy concerned attempts to retrieve Torres's gun. They said that Thomas told Torres in the fall of 2010 that he had bought the handgun from Harris, demanded that Torres give it to him, and then threatened a lawsuit to get it.