The woman allegedly woke to find Leading Seaman Sam Avery having sex with her, his hands on her waist and her pants pulled down to her knees.
The female sailor had turned down two of his previous advances before falling asleep after agreeing to let LS Avery stay the night in her bed, the hearing was told.
She said the attack ‘came out of nowhere’ as there was not even a friendly hug or kiss between the two and the only sexual contact between them was the advances she had rejected.
People warned not to go to popular beach this weekend unless they have booking
Royal Navy warship based in Portsmouth is due to set sail on a three-year mission to maintain the security in Gulf
Crash on M27 at Fareham leaves two lanes blocked causing heavy delays for drivers in heatwave
Fareham dog walker and trainer Ian 'Wiggy' Symes thought to be killed by XL American Bully breed dog
Thunderstorms yellow weather warning issued over Waterlooville, Fareham and parts of Hampshire by Met Office with chance of 'heavy rain'
After waking and realising what was happening, the woman told the court she asked LS Avery, who worked refuelling stealth fighters on aircraft carrier HMS Prince of Wales, ‘have you realised what you have just done?’
Prosecuting, William Peters told the hearing she had gone to a pub in Portsmouth with friends to watch a football match before making her way back to her accommodation.
Mr Peters said the pair knew of each other through social media but the woman did not know LS Avery’s name as he messaged her using a group account.
During the course of her evening at the pub, she had been exchanging messages with LS Avery, of 207 Squadron RAF Marham, Norfolk, which is a joint RAF and navy unit for the F35 Lightning stealth fighter.
After bumping into him, she invited him back to her room for a drink and was happy to let him sleep in her bed as it was common for sailors to bunk with each other, especially if one lived far away, the court heard.
Mr Peters said: ‘He made two efforts to touch her intimately but she rebuffed his advances and pushed him away.
‘She then woke and her pants had been pulled just below her knees, and his hand was around her waist.’
In a police interview shown to the court, the woman said she was shocked by the alleged attack, saying: “He [touched] me on my waist area and I grabbed his hand and went ‘no’ and then he stopped.
‘And then about five minutes later he proceeded to do it again and I grabbed his hand and said ‘no I told you not to’ and then he stopped again.
‘I drifted off to sleep [and] was awoken by him inside of me. I said ‘what are you doing, have you realised what you have just done?
‘And he grunted. I remember trying to process what the hell had just happened - it was shock as well because there was no intention whatsoever. Not even a friendly hug. There was no kissing.
‘There was no sexual gesture when we were in that room at all. I was in shock because it just came out of nowhere.’
In the interview, the woman said LS Avery was making pleasure noises and grunting as the alleged rape took place.
The court heard LS Avery’s DNA was found inside her.
In the police interview, she said LS Avery messaged her the day after the incident asking about what had happened and if she was ok.
She added: ‘I replied saying “I am traumatised by me waking up to you inside of me”.
‘He said ‘are you sure?’ I put ‘yes I am sure.’ Then he said ‘are you okay?’ I said ‘no I am not okay after what you did to me, you did not have consent.’
‘He read that and never replied.’
Bulford Military Court, in Wiltshire heard LS Avery claims he has no memory of having sex with her but, if anything did happen, it must have been consensual.
He denies one charge of rape. The trial continues.