Bill Cosby claims he's been double-dealt by the Montgomery County D.A. who violated a promise the comedian would never be prosecuted ... and Cosby now wants the case thrown out.
The comedian's lawyers just filed a motion to have the D.A. removed from the case and the charges dismissed. According to the lawyers, there was an explicit agreement in 2005 -- when the case involving Andrea Constand was initially rejected -- that it was over once and for all.
The lawyers say that's why Cosby sat for depositions in 2005 and 2006 ... because there was no need to assert the 5th Amendment right against self-incrimination since there was no chance a criminal case could be filed.
The lawyers say the new D.A., Kevin Steele, intentionally violated the clear agreement by filing charges.
Steele made the Cosby case a campaign issue and even announced charges before he was sworn in.