The incidence of ectopic pregnancy is up to four times higher after in vitro fertilization/intracytoplasmic sperm injection (IVF/ICSI) than in spontaneous pregnancies, and the risk of ectopic pregnancy is increased by tubal factor infertility and the transfer of multiple embryos. However, the effect of embryo quality on the probability of ectopic pregnancy has not been investigated until now and it is not clear whether ovarian stimulation parameters affect the incidence of ectopic pregnancy. An historical cohort study of 15 006 clinical pregnancies (diagnosed by ultrasound at 6-8gestational weeks) after non-donor IVF/ICSI with fresh embryo transfer (n=8952) or frozen-thawed embryo transfer (n=6054). Treatments were performed during 2000-2017 in Finland. A total of 9207 (61.4%) single and 5799 (38.6%) double embryo transfers of no more than one top-quality embryo were evaluated. We analyzed the effects of multiple factors on ectopic pregnancy by logistic regression, including type of cycle (fresh vs frozen embryo transfer), female age, number and quality of embryos transferred, tubal factor infertility and factors of ovarian response to gonadotropin stimulation. Ectopic pregnancy was observed in 2.3% of cycles. There was no significant difference in ectopic pregnancy rate after fresh embryo transfer and frozen embryo transfer (2.2% vs 2.4%, p=0.3). The ectopic pregnancy rate was lower in cycles with top-quality embryo transfer (1.9%) than of those where only non-top quality embryos were transferred (2.7%, p < 0.0001). Tubal factor infertility was diagnosed more often in ectopic pregnancy than in intrauterine pregnancies (21.2% vs 11.0%, p < 0.0001). Logistic regression revealed lower odds for ectopic pregnancy after a top-quality embryo transfer than after transfer of a non-top quality embryo (odds ratio [OR] 0.72, 95% confidence interval [CI] 0.56-0.92, p=0.007). Transfer of two vs one embryo (OR 1.35, 95% CI 1.05-1.70, p=0.02) and tubal factor infertility (OR 2.21, 95% CI 1.68-2.91, p < 0.0001) significantly increased the risk of ectopic pregnancy. Transfer of non-top quality embryos is associated with a higher rate of ectopic pregnancy. This is particularly important to keep in mind in treatments with only non-top embryos available even in the absence of tubal factor infertility. To minimize the risk of ectopic pregnancy, the number of embryos transferred should be as low as possible.