A judge sentenced a former D.C. police officer who served as a pimp for two teenage girls to seven years in prison Thursday.

Linwood Barnhill Jr., 48, who resigned from the Metropolitan Police Department after his arrest, pleaded guilty to two counts of pandering a minor and one count of possession of child pornography. After his release from prison, Barnhill will be under 10 years of supervised release and must register as a sex offender for the rest of his life.

Police arrested Barnhill Dec. 3 after a search for a missing 16-year-old girl led officers to his apartment. Court records say that over the previous two weeks, Barnhill prepared her for a sexual encounter with a man, preparation that included taking nude and clothed photos of her, but that sexual encounter never happened. The girl told police that she met Barnhill at a mall and he asked her if she would be interested in modeling.

A 15-year-old girl told police that Barnhill set up a sexual encounter for her after he pulled up to her at a bus stop in September 2013 and asked her if she was interested in modeling for him, according to the government's evidence. Barnhill took nude and clothed photos of her as well, and she engaged in sexual acts with a man in his 40s or 50s in Barnhill's bedroom, charging documents said. Barnhill allegedly provided condoms for the encounter, collected money from the man and paid the girl a portion.

Barnhill also pulled up to a 17-year-old at a bus stop in October 2013 and asked her if she wanted to model for him, the U.S. Attorney's Office said. He later took photos of her clothed and unclothed and shot video on his phone of her engaged in a sexual act with him.

During a search of Barnhill's apartment, investigators found 100 to 200 condoms, an officer with the department's Juvenile Protection Division testified. The officer said the large amount of condoms was in line with something that would be found in a brothel.

The judge said she accepted the light sentence -- Barnhill faced a maximum sentence of 24 years -- primarily to protect the victims' privacy, News4's Mark Segraves reported, but also because Barnhill didn't abuse his police powers in committing the crimes.

The attorney for one of the teenagers disputed that, saying his client was afraid to testify because more officers could be involved.

"The victim that I represent understood him to be a cop," attorney William Johnson said. "She actually rode in a car with him, and he pulled a gun from underneath the seat and bragged about being a D.C. police officer."

Barnhill's arrest followed a string of troubling events for the department. The same month Barnhill was arrested, Marc Washington, another officer with the MPD, was arrested on child pornography charges. His body was pulled from the Washington Channel weeks later.

A third officer was also under investigation for possibly tipping Washington off about his forthcoming arrest.

All three officers were employed in MPD's Seventh District, law enforcement sources said.