A nursing home resident has been credited for fighting off an intruder during a violent sexual attack on New Year's Day.
The 76-year-old woman was in her room in a Coffs Harbour aged-care facility when an unknown man, wearing a stocking over his head, entered through a courtyard door about 2.20am.
The man pinned his screaming victim to the bed before sexually assaulting her.
But the attack was cut short when the woman scratched her attacker in the face and kicked him in the groin, forcing him to move back.
She fled through an internal door and alerted the facility's staff as the intruder escaped through the courtyard.
Police arrested a 29-year-old man on Thursday in Coffs Harbour after painting a picture of the crime with fingerprints, other forensic evidence and the woman's "very good" police statement.
"Usually people in nursing homes are very fragile," NSW Police Sex Crimes Squad Commander Jayne Doherty said on Friday.
"And while she has health issues, we're very lucky in this instance that she was agile enough and cohesive enough to be able to give us a very good statement and to be able to try and defend herself, which reduced the amount of time he had to commit this offence."
All the evidence pointed to it being a random attack with the facility bringing in extra security guards since the assault to help residents feel safe, police said.
The woman was taken to hospital with minor physical injuries and was being supported by family.
"But as you can understand, an attack like this in the security of your own bed is very hard to come to terms with," Detective Superintendent Doherty said.
The alleged intruder - a local of no fixed address - was arrested on Thursday afternoon before being charged with aggravated sexual assault.
If convicted, he faces a maximum of 20 years in prison.
He did not apply for bail during a brief appearance in Port Macquarie Local Court on Friday.
The case was adjourned to Monday and transferred to Coffs Harbour. Police have resolved to oppose any bail application.
The incident bears similarity to a fatal assault on a 90-year-old woman in a Central Coast nursing home in November.
Brett Anthony Crawford, 34, allegedly broke in about 12.40am and used bedding to silence the woman's calls for help as he attacked her.
She died of her injuries almost two weeks later.
Crawford has been remanded in custody ahead of his next appearance at Gosford Local Court in February.
Det Supt Doherty said despite the similarities, there appeared to be no connection between the two matters.
But police across the country were continuing to work with nursing homes and residential care facilities to strengthen their knowledge and security within their grounds.
"Nursing homes have to balance the rights of the residents and their right to come and go freely, with their safety," she said.