Sulfamethoxazole has been extensively detected in aquatic environments worldwide, posing a great risk to human health. Although clay minerals are effective adsorbents for contaminants, investigations of the adsorption of sulfamethoxazole on clay minerals remain limited. In this paper, the adsorption of anionic sulfamethoxazole (SMX − ) from bulk to layered double hydroxides (LDH) surface was simulated by molecular dynamics. The electrostatic interaction between LDH and SMX − drove the adsorption. Four adsorption configurations of SMX − were identified: two with NO 3 − ions inserted between SMX − and the LDH surface, one via water bridging and one directly forming hydrogen bonding with the hydroxyl hydrogen atoms of LDH. The adsorbed SMX − exhibited significantly lower diffusion coefficient than that in the bulk, indicating that LDH has an advantage over common clay adsorbents (e.g., montmorillonite) in removing SMX − from water. The adsorption process was demonstrated to be enthalpy-driven by thermodynamic analysis. The free energy well in the weakly ordered water layer was deeper than that in the strongly ordered water layer, which explained why SMX − preferred to stay in the former. To enter the free energy barrier in the latter, SMX − was required to overcome the barrier by exchanging with adsorbed NO 3 − ions or breaking the ordered water layer.