NEW YORK -- Two New York police officers accused of raping an 18-year-old woman in their police van have quit the force, reports CBS New York.

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

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.

Get Breaking News Delivered to Your Inbox

The woman's attorney told CBS New York last month that the woman was driving with two friends in Brooklyn when two plainclothes detectives in a black van pulled them over.

David told the station one of the friends had some pills on him, along with a prescription. The detectives allegedly told the two friends to leave. The detectives then allegedly told the woman she was under arrest, handcuffed her and put her in the van. The station reports they drove her to a parking lot where they allegedly sexually assaulted her in the van.

Prosecutors said DNA recovered from a rape kit taken that same night matched both defendants. NYPD Commissioner James O'Neill told CBS New York that if the departmental charges were upheld, he would have fired the two officers.

"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," O'Neill said. "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."

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.