This paper used the newly developed terahertz time-domain spectroscopy (THz-TDS) to detect pesticides, especially imidacloprid, qualitatively and quantitatively in the frequency range of 0.5-1.6 THz. All together, four pesticides and three food powders, as well as polyethylene, were investigated. Different weight ratios of imidacloprid in polyethylene and in sticky rice powder were detected and analyzed with the partial least squares (PLS) regression method. Results show that all four pesticides exhibit unique absorption peaks in the terahertz range, and can thus be easily discriminated between each other and from those food powders that show similar and featureless absorption coefficients. Differences in the refractive indices can also be observed between the pesticides and food powders. Imidacloprid can be identified with its absorption fingerprints in the imidacloprid and polyethylene and imidacloprid and sticky rice powder mixtures. We have achieved the relative error of less than 5% predicting the weight ratio of imidacloprid in these two mixtures with the PLS method, according to the linear relationship found between the absorption coefficient and the weight ratio. In all, the THz-TDS technique is quite promising for the nondestructive pesticide residual detection in food safety control in the near future.