David Schubert -- the deputy D.A. in Las Vegas who prosecuted Paris Hilton and Bruno Mars for cocaine possession -- has beaten his bosses to the punch ... he resigned after his coke arrest.
The D.A.'s office was already in the process of firing Schubert -- in fact, they had already locked him out of his office -- so David decided to cut his losses ... and quit.
As we previously reported, 47-year-old Schubert was no small timer -- according to the police report, the man scored coke 3 to 4 times a week ... at the same time he was prosecuting Paris and Bruno Mars for cocaine possession.
Talk about putting your career on the line.