Hormonelike substances (prostaglandins) involved in pain and inflammation trigger the uterine muscle contractions. Higher levels of prostaglandins are associated with more-severe menstrual cramps.