Primary dysmenorrhea is typically caused by the release of prostaglandins during menstruation. These substances cause the uterine muscles to contract, leading to pain. It usually starts soon after a girl begins menstruating and can diminish with age or after childbirth.