A former D.C. police officer was convicted in federal court Tuesday on charges he solicited two underage teenage girls online and then paid them for sex, according to court records.

Chukwuemeka Ekwonna, 29, of Glenn Dale, Md., pleaded guilty to two counts of sex trafficking a minor, while eight other counts including illegal use of a firearm and robbery were dropped as part of a deal with prosecutors, court records show. Under the terms of the deal, Ekwonna faces between 10 and 20 years in prison when he is sentenced on May 10.

Ekwonna admitted to creating an account on the social media site Tagged in 2010 and then sending messages to many users, offering to pay them to engage in specific sex acts, according to court records.

Ekwonna exchanged dozens of messages with a 14-year-old girl and a 15-year-old girl, before meeting both for sex in the back of his car or at motel rooms in the Annapolis area on multiple occasions, court records show. Both girls were in the 9th grade at the time.

When Ekwonna was initially charged, the U.S. attorney’s office for the District of Maryland alleged Ekwonna pointed a gun at the 15-year-old girl and demanded she return the money he had just paid her during one of their encounters in January 2017.

“Police officers are sworn to protect our communities, not prey on our youth,” said U.S. Attorney Robert K. Hur. “We will continue to work with our partners to bring traffickers to justice and protect our most vulnerable.”

Ekwonna had been on the force for roughly 14 months and was fired in April.

He applied for the job with the D.C. police while he was facing a lawsuit for allegedly beating an inmate at the D.C. jail, where he previously held a job. The lawsuit was eventually settled for $20,000.

D.C. Police Chief Peter Newsham said last year the department was reviewing how Ekwonna was hired with the lawsuit pending. A D.C. police spokesman on Tuesday did not immediately know if that review has been completed.

Ekwonna’s attorney did not immediately return a call for comment.