We present new mid-infrared (MIR) diagnostics to distinguish emission of active galactic nuclei (AGN) from that originating in starburst regions. Our method uses empirical spectroscopic criteria based on the fact that MIR emission from star forming or active galaxies arises mostly from HII regions, photo-dissociation regions (PDRs) and AGNs. The analysis of the strength of the 6.2micron Unidentified Infrared Band (UIB) and the MIR continuum shows that UIBs are very faint or absent in regions harboring the intense and hard radiation fields of AGNs and pure HII regions, where the UIB carriers could be destroyed. The MIR signature of AGNs is the presence of an important continuum in the 3-10micron band which originates from very hot dust heated by the intense AGN radiation field. Using these two distinct spectral properties found in our MIR templates, we build diagnostic diagrams which provide quantitative estimates of the AGN, PDR and HII region contribution in a given MIR spectrum. This new MIR classification can be used to reveal the presence of AGNs highly obscured by large columns of dust.