NEW YORK (CBSNewYork) — Two NYPD officers accused of raping an 18-year-old woman in their police van have quit the force.

Eddie Martins and Richard Hall walked into police headquarters on Monday and resigned days before they were to face a departmental trial that could have resulted in their firing.

READ MORE: Israel's Parliament Approves New Government, Ending Netanyahu's 12-Year Rule

The two officers, who were assigned Brooklyn South Narcotics Division, were arraigned last week on a 50-count indictment charging them with rape, felony sexual assault and kidnapping.

Prosecutors said the officers stopped the woman in September for suspicion of drug possession and then handcuffed her, drove her around and raped her.

Prosecutors said DNA recovered from a rape kit taken that same night matched both of defendants.

“When a member of the NYPD is indicted on serious charges like these, it tarnishes all of the admirable things accomplished by other, good officers every day in neighborhoods across New York City. It also stains the legacies of those who paid the ultimate sacrifice in service to New Yorkers. Today, the two men at the center of these allegations quit their jobs as police officers,” NYPD Commissioner James O’Neill said. “Had these charges been upheld in an upcoming departmental trial, I would have fired them immediately. And I would have done so on behalf of every NYPD cop, because we owe the communities we serve – as well as the honest, hardworking men and women of this department – nothing less.”

READ MORE: Ned Beatty, Legendary Character Actor Known For 'Deliverance,' 'Network,' Dead At Age 83

Martins and Hall, who were demoted from detective to officer following the alleged rape, claimed the sex was consensual.

The officers’ lawyers have said the woman’s account is not credible.

Martins and Hall pleaded not guilty on all counts and are due back in court on Jan. 18.

Their resignations mean they will not collect a pension.

MORE NEWS: Italian-Americans Take Issue With Randolph, N.J. Board Of Education's Decision To Drop All Holidays From Calendar

(© Copyright 2017 CBS Broadcasting Inc. All Rights Reserved. The Associated Press contributed to this report.)