Ben Harvey, 22, of Little London, near Andover, is accused of the murder of William Rudiak and assault causing actual bodily harm to the victim's girlfriend, Alexandra Taylor.
He also faces a third charge of trespass with intent to commit a sexual offence.
The trial at Winchester Crown Court has heard that Harvey is accused of entering the home of Ms Taylor in Turin Court, Andover, in the early hours of June 11 last year, where he stabbed her boyfriend, Mr Rudiak, with a kitchen knife while he slept in bed, before biting her on the cheek, waking her up.
He is accused of then driving to a nearby village and gaining access to a cottage where he attempted to remove the pyjama shorts of a teenage girl as she slept in bed.
The girl said in a video interview shown to the court: 'It was about 3.45am, I saw the light go on and off but I was half asleep at this point. I thought it was just the electricity, I didn't think much of it.
'Then I woke up to someone's hand round my mouth as if they were trying to stop me speaking or screaming or making any noise.
'The duvet was off me and he had his hand over my mouth and he tried to get my shorts off. He tried to get on top of me and I tried to fight him off, I tried to get him off and was screaming.'
She added: 'I think he was trying to rape me. I was so shocked.'
She continued: 'I managed to hit him round the head to get him off me, he didn't say a word during the whole thing. He went out of my room and sprinted down the stairs and out of the house.'
The teenager added that she suffered scratches to her back and chin in the incident.
Police Constable Yana Glover told the court that she attended the address in Turin Court earlier that night, where she found Ms Taylor in a 'distressed state' with Mr Rudiak covered in blood.
When she entered the house with a colleague, PC Glover said Ms Taylor was 'screaming very loudly, extremely distressed, repeating 'He's not breathing''.
She continued: 'She gave me a brief account, although she was still crying a lot. She had been woken up by a man biting her face, he fled very quickly and her partner in the bed said something like 'It hurts' and was covered in blood.'
She added that, when Ms Taylor was informed that her boyfriend had died, 'she fell to the ground screaming'.
The defendant denies the charges.