Sharp spasms?

I woke up during the middle of the night to what I can only describe as sharp spasms in my tummy and going into my rectal area, I couldn’t move and if i sat up they got so much worse. I don’t have a clue what they were.. I had a miscarriage last year and one night after my d&c I had the same pain and it was excruciatingly sore and lasted all night. It’s like my tummy is covered by electric shocks and is spasming like crazy every few seconds. It wasn’t as bad last night and only lasted 5 minutes I eventually managed to get up but it was so uncomfortable! I was lying on my back btw and when I turned to my side it eased off, a lot. Anyone know what on earth that could have been? I’m 15 weeks by the way!