Two NYPD officers accused of raping an 18-year old girl have quit.

Police say Detectives Eddie Martins and Richard Hall resigned at their headquarters Monday.

The pair is accused of arresting a teenager in Brooklyn in September on charges of carrying marijuana and an anti-anxiety drug.

The officers then allegedly sexually assaulted her in a police van.

Their lawyer says the sex was consensual and they pled not guilty.

Since then they were released on bail.

They had been set to appear at a departmental trial tomorrow for violating procedures.

Police Commissioner James O'Neill said in a statement: "Today, the two men at the center of these allegations quit their jobs as police officers. 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."