Abstract Study question To evaluate the effectiveness of surgical treatment of endometrioid cysts and deep infiltrative endometriosis before an IVF program Summary answer Laparoscopic excision of deep infiltrative endometriosis has a positive effect on the reproductive function of women What is known already One of the most severe and aggressive manifestations of endometriosis is deep infiltrative endometriosis. Endometriosis is a socially significant disease that reduces a woman’s quality of life and affects reproductive health. Women with endometriosis often experience severe menstrual and non-menstrual pain affecting the lower abdomen, pelvis or lumbosacral region, profound dyspareunia, dyschezia and dysuria (Uimari et al., 2021) and infertility in 30–50% of cases (Prescott et al.., 2016). Patients with endometriosis suffer from chronic fatigue (Ramin-Wright et al., 2018) and have a higher risk of mental health problems (56.4%) than patients without endometriosis (43.6%) (Pope et al., 2015) Study design, size, duration The our institute is conducting a controlled, non-randomized, retro- and prospective study on genital endometriosis. The study period is from 2012 to the present. Participants/materials, setting, methods The study included 450 women with deep infiltrating endometriosis in combination with infertility All patients were divided into 4 groups Group 1 – 128 patients with deep infiltrative endometriosis, sent for IVF without surgery Group 2 – 297 patients with deep infiltrative endometriosis, initially referred for surgery Group 2a – 156 patients with ovarian cysts, sent for preliminary collection of eggs before surgery Group 2c – 141 patients with ovarian cysts, referred for surgery without prior egg retrieval Main results and the role of chance In group 1, the number of pregnancies occurred was 65.6% (84 women), in group 2a - 71.7% (112 women), in group 2 - 53.9% (76 women). Pregnancy occurred spontaneously in 18 (4.2%) women from group 2 after surgery. In group 2, four women, after three unsuccessful attempts at in vitro fertilization, became pregnant after using donor eggs - the results were excluded from the final pregnancy calculations. In terms of pregnancy, IVF with preliminary surgery (Me: 2.10; Q1-Q-3:0) had a statistically significant advantage compared to IVF without surgery (Me: 5.00; Q1-Q-3:0), and IVF with surgery without egg retrieval (Me:3.0; Q1-Q-3:0). The lowest statistically significant pregnancy rate was recorded during laparoscopic surgery without prior egg retrieval (Me: 6.95; Q1-Q-3:1). When performing a post-hoc analysis, a statistically significant shorter pregnancy time was also found when performing IVF with preliminary laparoscopy and egg freezing: group 1 (M: 126.25; SD111.1), group 2a (M: 79.97; SD: 19.785 ), group 2c (M: 130.50; SD: 82.149) (p = 0.000). During the period of observation of women for twelve years after surgery, 93% of patients noted an improvement in the quality of life and 63.7% of women on average achieved reproductive function after the IVF program for endometriosis. Limitations, reasons for caution no restrictions Wider implications of the findings The results of the IVF program for deep infiltrative endometriosis are statistically higher after surgery, but with preliminary cryopreservation of oocytes. The question of radical resection of the rectum in comparison with shaving when planning an IVF program remains open, which forms the planning of further research in this area. Trial registration number not applicable