Pain during sex

Lucky
Recently I had kind of "meh" Sex with someone I've had sex with before. Everything was fine, but I felt really uncomfortable at first in a situation I'm normally fine in, and eventually started experiencing pain during intercourse? This hasn't happened to me before, but my body just seemed to be constantly yelling at me that it didn't feel right. Later, experienced cramps. Haven't gotten my period yet, but it's due soon. So why did it hurt the last time? Was it just cramps, or maybe some sort of irritation? It was not a pleasurable form of pain like sometimes occurs. Just confused here :/