Ectopic pregnancy occurs when a fertilized egg implants outside of the uterus, most commonly in the fallopian tubes. Risk factors include prior tubal surgery, genital infections, infertility treatments, smoking, and more. Diagnosis involves evaluating symptoms, risk factors, ultrasound imaging, and beta-HCG levels. Treatment depends on whether the ectopic pregnancy has ruptured or not. Unruptured ectopic pregnancies can sometimes be treated with methotrexate or laparoscopic surgery, while ruptured ectopic pregnancies usually require emergency surgery.