Objective To analyze the efficacy of vitrectomy in patients with intraocular foreign body and endophthalmitis.Methods 80 patients with intraocular foreign body with infectious endophthalmitis who treat-ed at Yinchuan Jinchuan Eye Hospital with vitrectomy treatment from April 2021~April 2024 were selected as the study subjects.The basic data,intraocular foreign body,surgical effect,and influencing factors of postoperative visual acuity were analyzed.Results Among the 80 patients,71 were male(88.75%),73 were young or mid-dle-aged who aged 18~65 years old(91.25%),and 61 were from rural areas(76.25%).In 47 patients,the intraoc-ular foreign body was metallic(58.75%).The ocular foreign body in 50 patients was in area Ⅰ(62.50%),the ocular foreign body in 43 patients was small and less than 3 mm in diameter(53.75%),and the ocular foreign body in 65 patients was incarcerated outside the macula(81.25%).All patients had intraocular foreign bodies successfully re-moved by stage Ⅰ surgery.Only 14 patients(17.50%)had a preoperative best corrected visual acuity(BCVA)≥ 0.1,while 33 patients(41.25%)had a BCVA ≥ 0.1 one week after surgery,and the operation significantly improved the visual acuity of the patients(P=0.001).Preoperative BCVA<1,retinal detachment,and foreign body diameter of ≥ 3 mm were independent risk factors affecting the recovery of postoperative vision.Conclusion Vitrectomy can effectively improve BCVA with significant clinical efficacy.The factors affecting the postoperative visual acuity of patients were mainly related to preoperative BCVA,retinal detachment and foreign body diameter.