A woman's skull was shattered in a "savage sexual and physical assault" in a children's play park, a court has heard.
The alleged victim, in her 50s, was found in the park off Cedar Road, Evington, Leicester, on 3 August.
The prosecution at Leicester Crown Court said "miraculously" the woman did not die following the attack.
Zakarya Etarghi, 24, of no fixed address, denies rape and attempted murder.
The court heard the woman suffered massive facial trauma, a complex open skull fracture with bleeding to the brain, life-threatening low blood pressure, contusion to the left lung, spinal fractures and significant brain injuries.
William Harbage QC, prosecuting, said the victim's injuries were assessed as "life-threatening" and that "you can be in no doubt that she was raped".
He added that "her injuries have been life-changing".
The court heard Etarghi had said in a police interview he was present in the park with the alleged victim and they had drunk and taken cocaine together.
Mr Harbage added: "He admits that they kissed and touched each other in a sexual way.
"He claims he did nothing wrong at all that night, that he used no force on her at all, he left her in the park uninjured in any way.
"He says, by coincidence, someone else must have come along just after he had left, and that someone else must be responsible for the savage attack which was then perpetrated on the unfortunate [alleged victim]."
DNA profiles obtained from blood from pieces of paper and cigarette packets in the defendant's flat matched that of the woman, the prosecution said.
The jury heard that days after the attack, in WhatsApp messages to friends, Mr Etarghi said: "I can just see it, today's the day I get nicked", and "I'm looking at 10-20", which the prosecution suggested referred to the number of years in prison.
The court was told within six hours of the attack, the defendant was searching online for "crime news" and the incident in Cedar Park.
Later that day he "fled from Leicester" and went to Stoke-on-Trent, the court heard.
The trial continues.