This sounds like an anxiety or panic attack. It probably will not be a sleep problem because it still happens even when you are awake.
Can I ask whether you were awake or asleep the first time it happened. Also did it feel frightening or upsetting to quite a degree?
The fact that you say you have to calm yourself down by breathing is another indication of panic.
Panic attacks happen for many reasons and sometimes those reasons are very flimsy.
If you had a sudden shock of panic, didn't like it because you were frightened by it, noticed the time (whether consciously or subconsciously) and then thought about the event for a while because you were trying to figure out what exactly happened etc this could bring it on again. And once it has happened twice, three times you get stuck in your own worry about it, therefore bringing it on again.
It doesn't matter if you are asleep or not, your mind always knows what time it is (that's the reason why people wake up just before there alarm among other things) and it will know when to panic.
The best thing you can do is try to relax. Do this any way you feel. Take a bath before bed, put some lavender oil on a tissue in your pillowcase. Also ask yourself why you are concerned. Challenge your subconscious. Ask what is the worst that could happen if you did it again. Ask if that would really be THAT bad. Don't get disheartened if it doesn't go straight away and likewise if it goes and returns again. It will diminish the less you let it play on your mind. Let us know how you get on.
Good luck and don't worry.