Do gas and diarrhea cause cramps?

Tara • Have two beautiful children
I woke up this morning with the immediate need to go poop. I can't believe how bad I had to go. I also have lots of built up gas. I started to feel some minor cramps and was curious if the gas could cause that?