Belly pains

Last night after my boyfriend and I were done having sex, I felt a slight pain in my stomach then this morning the pain woke me up and it felt so excruciating. The pain spread to my back as well, like an awful cramp or something. I took some pepto and it eased it and I was able to go back to sleep. I’m not sure if I just had built up gas or it could be something else. Has this ever happened to anybody else?