Objective: Prior use of antibiotics before immune checkpoint inhibitors (ICIs) has been reported to be associated with decreased efficacy of ICI in solid tumors. We evaluated the effect of the duration of antibiotics use before ICI on oncological outcomes. Methods: We examined patients with recurrent gynecologic malignancies with programmed death (PD)-1 monotherapy at two academic institutions. Clinical data, including antibiotics use within 60 days of initiation of ICI, type of antibiotics, reasons for antibiotics use, BMI, tumor site, chemotherapy-free interval, prior history of radiotherapy, the objective response (ORR), and overall survival (OS) were assessed. Results: A total of 215 patients were eligible, of whom 22.9% (47/215) received antibiotics before ICIs. Ovarian cancer was most common (52.1%, 112/215), followed by cervix (24.7%, 53/215) and endometrial cancer (16.7%, 36/215). When we divided the entire cohort based on prior use of antibiotics before ICIs, there was no difference in baseline characteristics. There was no difference in ORR between the two groups. BMI, dMMR, prior use of antibiotics, chemotherapy-free interval, and ECOG were associated with overall survival. In multivariate analyses, previous use of antibiotics with more than a cumulative dose of 14 days (HR 2.286; 95% CI 1.210 to 4.318; p = 0.011), ECOG 2 or 3 (HR 4.677; 95% CI 2.497 to 8.762; p < 0.001), and chemotherapy-free interval less than six months (HR 2.007; 95% CI 1.055 to 3.819; p = 0.034) was associated with poor overall survival. Conclusion: Prior use of antibiotics with more than a cumulative dose of 14 days was associated with reduced survival in recurrent gynecologic malignancies, which is in line with previous reports in non-gynecologic malignancies. To find a strategy to improve clinical outcomes with ICI in this population is needed.