I had experience too. One time I even needed to wake up three times before I really awaken.
When it occur, I used to try very hard and repeat big breath to wake myself up, it's useful. I found out that even you lose any controll of your muscles, you can't talk, yell, move your head... but except your breathing muscle, maybe it is because that muscle being controlled by intentionally or automaticly by our brain (I forgot how scientical words to express it). So maybe next time you can try it out.