In this study, the NiFe2O4@TiO2 magnetic nanocomposite was synthesized by the green synthesis method, which is an efficient and economical method. Pulicaria Gnaphalodes plant extract was used for nanocomposite synthesis because this method is suitable for the biosynthesis of nanocomposites on a large scale, and the nanocomposite produced by plants is more stable. The efficiency of the synthesized nanocomposite was investigated for the photocatalytic degradation of Penicillin G (PNG) under UVC light irradiation in aqueous solutions. The structural characteristics of this nanocomposite were determined by field emission scanning electron microscopy, transmission electron microscopy, X-ray diffraction, Fourier transform infrared spectroscopy, vibrating sample magnetometer, and dynamic light scattering. The effect of different parameters including pH, nanocomposite dose, penicillin G concentration and time were studied to reach optimum conditions. About 71% of PNG in optimal conditions (pH = 9, nanocomposite dose = 0.6 g/L, and penicillin G concentration = 10 mg/L) was decomposed. Generally, the NiFe2O4@TiO2 nanocomposite can be used as an efficient catalyst for the degradation of PNG in aqueous solutions.