An N,S-codoped TiO2/Montmorillonite nanocomposite, as a photocatalyst, was synthesized in the sol-gel method and used for the degradation of ciprofloxacin (Cip) in an aqueous solution. N,S-codoped TiO2/Montmorillonte was characterized by powder X-ray diffraction (XRD), UV-Vis diffuse reflectance spectroscopy (DRS), field emission scanning electron microscopy (FESEM), transmission electron microscope (TEM), and X-ray fluorescence (XRF) analyzes. A central composite design (CCD) was used to optimize the variables for the removal of Cip by the N,S-codoped TiO2/Montmorillonite. A maximum decomposition of 92% of Cip was achieved in optimum conditions. The band gap value for the nanocomposite was 2.77 eV. Moreover, with the use of nanocomposite in the four consecutive runs, the final removal efficiency was 66%. The results show that the N,S-codoped TiO2/ Montmorillonite under simulated sunlight irradiation can be applied as an effective photocatalyst for the removal of Cip from aqueous solutions.