Drying-rewetting (DW) cycles can significantly influence soil properties and microbial community composition, leading to direct or indirect changes in arsenic (As) toxicity, which inturn affects soil ecological functions. Despite this, there has been insufficient focus on accurately evaluating As ecotoxicity and its impact on soil ecological function under DW conditions. This study seeks to address this gap by examining the effects of DW on As toxicity and the characteristics of soil ecological function, specifically from the perspective of enzyme-based functional diversity. Our results reveal that compared to constant moisture conditions, DW treatment significantly increased the toxicity of As on alkaline phosphatase and β-glucosidase, with maximum inhibition rates observed at 46.29% and 21.54%, respectively. Conversely, for other tested enzymes including invertase, fluorescein diacetate hydrolase, and dehydrogenase, DW treatment decreased As toxicity, possibly be due to the different stability of these enzymes under varying soil moisture conditions. From an enzyme functional diversity perspective, DW treatment reduced the As toxicity, as evidenced by the reduced inhibition rates and a lower coefficient of variation. In conclusion, DW appears to enhance soil functional resilience against arsenic pollution. These findings contribute to a better understanding of changes in ecological functions in heavy metal-contaminated soils under dynamic environmental conditions, offering insights for improved monitoring and mitigation strategies for metalloids toxicity in natural environments.