What happened last night???

Mi

Last night I woke up with excruciating lower back pain and abdominal pain. I’m about 6 weeks pregnant. It last for about 3 minutes and after I passed gas several times it went away. There was no spotting or bleeding. Was this just gas? Can gas cause pains this bad?