pains while having sex

So tonight my boyfriend and I were having sex and then suddenly my stomach and butt muscles seized up, it's like period cramps and the bad side of anal all together. Has anyone else had this? Any idea what it could be?