An ectopic pregnancy occurs when a fertilized egg implants outside the uterus, often in a fallopian tube. Signs include sharp pelvic pain, vaginal bleeding, and shoulder pain. This condition is a medical emergency and requires prompt treatment, which may involve medication or surgery to prevent complications.