Nickel (Ni) is a heavy metal element and a pollutant that threatens the organism's health. Melatonin (Mel) is an antioxidant substance that can be secreted by the organism and has a protective effect against heavy metals. Selenoprotein M (SelM) is a selenoprotein widely distributed of the body, and its role is to protect these tissues from oxidative damage. To study the mechanism of Ni, Mel, and SelM in mouse spleen, 80 SelM+/+ wild-type and 80 SelM-/- homozygous mice were divided into 8 groups with 20 mice in each group. The Ni group was intragastric at a concentration of 10mg/kg, while the Mel group was intragastric at 2mg/kg. Mice were injected with 0.1mL/10g body weight for 21days. Histopathological and ultrastructural observations showed the changes in Ni, such as the destruction of white and red pulp and the appearance of pyroptosomes. SelM knockout showed more severe injury, while Mel could effectively interfere with Ni-induced spleen toxicity. The results of antioxidant capacity determination showed that Ni could cause oxidative stress in the spleen, and Mel could also effectively reduce oxidative stress. Finally, Ni exposure increased the expression levels of the pyroptotic genes, including apoptosis-associated speck protein (ASC), absent in melanoma-2 (AIM2), NOD-like receptor thermal protein domain-associated protein 3 (NLRP3), Caspase-1, interleukin- (IL-) 18, and IL-1β (p < 0.05). Loss of SelM significantly increased these (p < 0.05), while Mel decreased the alleviated impact of Ni. In conclusion, the loss of SelM aggravated Ni-induced pyroptosis of the spleen via activating oxidative stress, which was alleviated by Mel, but the effect of Mel was not obvious in the absence of SelM, which reflected the important role of SelM in Ni-induced pyroptosis.