Sulfamethoxazole (SMX) is a widely used antibiotic for bacterial infections and is frequently found in surface waters and wastewater treatment plant effluents, where it is commonly co-administered with trimethoprim. Because of its emerging ecological and health risks, the development of effective elimination strategies is urgently required. In this study, a rapid microwave-assisted technique was employed to synthesize a Pd/g-C3N4 photocatalyst for the elimination of SMX in aqueous solution. The structure and optical properties of all samples were characterized using X-ray diffraction (XRD), transmission electron microscopy (TEM), photoluminescence (PL), and UV-visible diffuse reflectance spectroscopy. The photocatalytic performance of Pd/g-C3N4 was systematically evaluated under visible-light irradiation. The results demonstrated that Pd/g-C3N4 achieved a 97% removal efficiency, significantly outperforming pure g-C3N4, which reached only 57% removal. The degradation rate constant for Pd/g-C3N4 was calculated to be 0.0139 min(-1), approximately 6.6 times higher than that of bare g-C3N4. This enhanced performance is attributed to the incorporation of Pd nanoparticles, which effectively suppressed the recombination of photogenerated electron-hole pairs and promoted charge separation. The influence of key operational parameters, including pH, SMX concentration, and catalyst dose, were systematically examined. Furthermore, the photocatalytic mechanism of the Pd/g-C3N4 photocatalyst was explored to elucidate its degradation pathways.