Pyrite, a mineral that can cause potential environmental issues in coal mining, is commonly found in coal seams around intrusions. In this paper, pyrites from the Yuandian Coal Mine (Huaibei Coalfield, Anhui, Eastern China) were studied using SEM, Raman and LA-ICP-MS. The pyrite morphologic and geochemical data suggest that (1) four pyrite generations are present (framboidal sedimentary pyrites (Py I) in the original coal, coarse-grained magmatic pyrites (Py II) in the intruding diabase, fine-grained metamorphic pyrites (Py III) in the intrusive contact aureole, and spheroid/vein hydrothermal pyrites (Py IV) in the cokeite); and (2) concentrations of cobalt, nickel, arsenic, selenium, lead and copper in the metamorphic pyrites are much higher than the other pyrite generations. We propose that mafic magmatism is the main contributor of the toxic elements to the intrusion-related cokeite at Yuandian.