Sulfamethoxazole (SMZ) is commonly used in aquaculture to treat bacterial infections, but its long-term residual properties in natural water can pose a direct threat to aquatic animals. This study is to investigate the effects of continuous exposure to SMZ on mud crabs (Scylla paramamosain) at four different concentrations (0, 10, 100, and 1000 ng/L) that reflect the range found in natural aquatic environments. The results confirmed that SMZ exposure reduced the expression levels of genes related to the innate immunity in mud crabs, including JAK, Astakine, TLR, and Crustin. It also stimulated oxidative stress, caused the production of reactive oxygen species and lower activities of antioxidant enzymes such as peroxidase, superoxide dismutase, catalase, and glutathione. SMZ exposure damaged the DNA of crab hemocytes and hepatopancreas tissue, and reduced the phagocytosis, ultimately leading to a decreased survival rates of mud crabs infected with Vibrio alginolyticus. These findings demonstrate that SMZ exposure has immunotoxic effects on mud crabs' innate immunity and reduces the ability to resist pathogen infections. © 2023 Elsevier Ltd