Police say they would not have laid charges against an elderly man with Parkinson's disease and possible dementia unless there was enough evidence.
The 69-year-old is accused of grabbing a woman in his care home and faces charges of indecent assault and common assault.
The home and his family won't care for him, so he is being held in isolation at Rimutaka Prison, near Wellington.
The man's lawyer, Michael Bott, says his client could be caught up in the recently passed three-strikes legislation if his illnesses cause similar offending in the future.
Mr Bott says dementia does not meet the threshold for being considered a mental disorder.
And ACT MP David Garrett, who pushed for the three-strikes law, says the justice system is failing mentally ill people.
But Police Minister Judith Collins says the law contains safeguards for the mentally impaired.
Mrs Collins says the courts have the option to discharge mentally ill people who plead guilty, or are found guilty, without conviction.