A preconcentration method was developed by using a new aminothioazole-containing sulfonamide resin in solid phase extraction for the determination of lead and nickel in milk and yoghurt samples. The optimisation of experimental conditions was performed. The optimum parameters for Pb and Ni were found to be 3.5, 30min and 2.5mL for pH, contact time, eluate volume, respectively. After preconcentration step, atomic absorption spectrometry was used for the determinations. The enhancement of 350- and 50-fold in the sensitivity of Pb and Ni were achieved by combination of the slotted tube atom trap-atomic absorption spectrometry with the optimised preconcentration method, respectively. Limits of detection were found to be 0.15ngmL −1 for Pb and 0.75ngmL −1 for Ni. The lead concentrations in the studied samples were found to be in the range of 15–61ng Pb mL −1 for milk and 21–42ng Pb g −1 for yoghurt samples.