Prosecutors have failed in a bid to have a 26-year-old West Australian man, convicted of brutally raping a five-year-old girl, listed as a dangerous sex offender.

Alton John Samson was serving the final stages of a seven-year jail term and was due for release on May 22 when the Director of Public Prosecutions filed an application on May 9.

Samson suffers from schizophrenia and is an involuntary patient at Graylands Hospital.

In his judgment on Tuesday, WA Supreme Court Justice John McKechnie said the application was argued on the basis of the seriousness of the single offence committed.

"The DPP has not adduced any evidence to show that a person who commits a single, albeit very serious sexual offence, is at risk of re-offending sexually in the future," he said.

Justice McKechnie said there was no evidence Samson was more likely to commit another sex offence simply because he had committed one such crime, or because he had a mental illness.

He said there was no evidence Samson had any pattern of sexual offending behaviour and it was pointless to detain him for treatment because he could not participate in a treatment program due to his mental health.

Justice McKechnie said the Dangerous Sex Offenders Act could not be used to provide mental health care for Samson.

"There are no reasonable grounds for believing that the respondent must be detained for the purposes of control," he said.

AAP