Yelling, and flailing during sleep

Patient: Hi,I am a 28 year old man and I have started punching, kicking, flailing around and yelling during sleep. My girlfriend tells me about it the next morning, but otherwise I would have no idea that such things were happening. On nights when this happens I wake up the next morning with terrible headaches. Any idea of what this could be?Thank you