I hope you'll see a doctor. It could be some type of seizure or pseudo-seizure. It could be a harmless hypnic jerk, something many people experience when they're falling asleep or relaxing.
If you're taking medication of any kind it could be a side effect. A pal of mine was jerking so bad that it was scary. Turned out it was one of the medications he took for anxiety and depression. It was washing important minerals out of his body. The doctor changed his meds and the jerks stops.
Here's an article talking about hypnic jerks. I have these pretty bad sometimes, usually when I've been feeling tense. They're bad enough to make me flail around unless I'm holding myself stiff.
BBC - Future - Why your body jerks before you fall asleep