A Blackpool mother thought she was dreaming when she was woken up by her 14-year-old son raping her, Preston Crown Court heard.
The woman woke up screaming during the alleged attack and was not going to report the incident until she realised the "enormity" of it.
She had been drinking the night of the purported rape and reaffirmed to family members, "I didn't dream it," the court heard.
The boy - who is now 15 and cannot be named for legal reasons - had suffered from behavioural problems and had shared his mother's bed from time to time.
Francis McEntee, prosecuting, said the teenager would tell jurors he climbed into bed with his mother because his bed was "uncomfortable", the Telegraph reported.
The prosecution said the youth was hoping to provide an innocent explanation for his presence in the bed.
McEntee added the woman was was naked apart from her underwear and that the boy had been lying with his arm around her.
During the hearing, jurors were played the alleged victim's police interview, during which her son left the courtroom.
In it she said: "All sorts was going through my head. Is he just sleepwalking? Does he know what he is doing?
"Is he aware? Now I am actually thinking what state is he in? Does he know what he has done?"
The defendant denies a charge of rape and the the trial continues.