Joshua Bote | USA TODAY

Two detectives with the New York Police Department accused of raping a teenager they had in custody will not be serving any jail time.

The detectives — Eddie Martins, 39, and Richard Hall, 34 — were accused in 2017 of raping a teenage girl they took into custody for marijuana possession. She was 18 at the time of the incident, according to a statement from the Brooklyn District Attorney’s office.

Martins and Hall will be sentenced to five years’ probation for pleading guilty to official misconduct and receiving a bribe. Sentencing is set for Oct. 10.

The victim was driving with two friends when Martins and Hall — who were not in uniform — pulled her over and found marijuana and Klonopin pills. After they detained her, according to the Brooklyn District Attorney’s office, “the woman had sexual intercourse with Martins and performed a sex act on Hall,” before releasing her without an arrest.

DNA was later obtained from the victim that matched both men.

New York law already prohibits sex between prison guards and inmates. The policy, prior to the incident, didn’t apply to officers and those in their custody.

Since then, New York lawmakers closed what they called a loophole — and police officers can be charged with third-degree rape for having sex with individuals in their custody.

"The outcome of this case is a clear example of why the new law prohibiting sexual contact between law enforcement officers and those in their custody was necessary," said Assemblyman Edward C. Braunstein, who introduced the law in 2017 with Council Member Mark Treyger after the incident, in a statement to USA TODAY.

“The power dynamic in these circumstances is such that the person in custody is incapable of consenting to sexual activity. This common sense law will ensure that moving forward officers who abuse their authority and engage in this type of coercive sexual behavior will be held accountable."

Prosecutors were unable to retroactively charge Martins and Hall for their crime. In March, the District Attorney's office dropped dozens of charges including rape, sexual assault and kidnapping, citing “serious credibility issues.”

“These defendants engaged in a shocking abuse of power which they finally acknowledged,” said Brooklyn District Attorney Eric Gonzalez in a statement. “While I would have preferred to see them serve prison time, they are no longer members of our police department and with today’s plea are convicted felons.”

Contributing: The Associated Press. Follow Joshua Bote on Twitter: @joshua_bote

View | 11 Photos

Protests erupt in New York to mark Eric Garner's death