Malaysia's Insanity Defence: Why It Rarely Works, and "Winning" Still Means Being Locked Up
In January 2024, Mohamad Safiq Rosli became the first person charged under Malaysia's new anti-stalking law, after sending a photographer three messages on X professing his love for her — the tail end of what she said was close to a decade of unwanted contact. A forensic psychiatrist testified Safiq had schizophrenia, and that his delusions made him genuinely believe they were in a relationship. The court agreed he could not understand what he was doing was wrong, and found him not guilty.
He did not go home that day. He was sent to Hospital Bahagia Ulu Kinta in Tanjung Rambutan, Perak, and ordered detained there "at His Majesty's pleasure", with no release date attached.
That's the part most people miss about what's commonly called the "insanity defence" in Malaysia. It exists. It occasionally succeeds. And when it does, the accused doesn't walk free — they can end up deprived of their liberty longer than a prison sentence would have run, with no end date at all.
Under Section 84 of the Penal Code, you're not criminally liable for an act committed while suffering "unsoundness of mind" so severe you couldn't understand what you were doing, or that it was wrong or against the law. But you, not the prosecution, must prove this — on a balance of probabilities under Section 105 of the Evidence Act 1950, lighter than "beyond reasonable doubt" but still a real burden. Courts apply the test narrowly: it must be a legal finding, not just a medical diagnosis, describing your mental state at the exact moment of the offence, not before or after. If you succeed, you are not released. Under Sections 347 and 348 of the Criminal Procedure Code, you're committed to a psychiatric hospital (usually Hospital Bahagia Ulu Kinta), detained "at the pleasure of" the Yang di-Pertuan Agong (the King) or the relevant state Ruler, with no fixed release date — potentially for life. That's different entirely from being ruled unfit to stand trial under CPC Sections 342–345, which asks whether you can follow proceedings right now, not whether you understood your actions when the offence happened.
1. What Section 84 Actually Says
The Penal Code (Act 574) doesn't use the word "insanity" at all. Section 84 reads: "Nothing is an offence which is done by a person who, at the time of doing it, by reason of unsoundness of mind, is incapable of knowing the nature of the act, or that he is doing what is either wrong or contrary to law."
Malaysian courts have never fixed a precise medical definition of "unsoundness of mind" — it's deliberately left open so judges apply it case by case, weighing psychiatric evidence and conduct together. The section only covers cognitive failure: not knowing what you were doing, or not knowing it was wrong. Section 84 doesn't cover someone who knew an act was wrong but felt unable to stop themselves — an "irresistible impulse" alone isn't a defence, however genuine the condition.
2. Where This Law Comes From: The M'Naghten Rules
Section 84 traces back to an 1843 English case with nothing to do with Malaysia. Daniel M'Naghten, suffering persecutory delusions, tried to kill British Prime Minister Robert Peel and shot his secretary, Edward Drummond, instead. He was acquitted on grounds of insanity, which caused enough outrage that the House of Lords set out formal rules for the defence — the M'Naghten Rules, built around whether the accused understood the nature and wrongness of the act.
When British India, and later British Malaya, codified their criminal law, the Indian Penal Code of 1860 wrote that cognitive test directly into what became Section 84. Malaysia, Singapore and India still run on close variants of it. Malaysia is still applying a test for the human mind that a 19th-century court invented before psychiatry existed as a medical specialty, and Malaysian academic commentary has repeatedly flagged this as overdue for review, without any amendment following.
3. Who Has to Prove It, and How High the Bar Is
Normally, the prosecution proves your guilt beyond reasonable doubt. Section 84 flips part of that. The law presumes every accused person sane, and it's the accused who must prove unsoundness of mind, on a balance of probabilities, under Section 105 of the Evidence Act 1950.
In practice that means psychiatric assessment, medical records, and evidence of how you behaved before, during and after the act — planning or fleeing tends to undercut a claim of unsoundness of mind, while disorganised or delusional behaviour tends to support it. In John Nyumbei v Public Prosecutor [2007] 7 MLJ 206, the Court of Appeal upheld a murder conviction despite evidence of a "psychotic disorder", because the examining psychiatrist also found the accused lucid and "in contact with reality" close to the relevant period — unsoundness of mind was not proven at the time of the act itself, the only moment that matters. A diagnosis covering weeks or months isn't proof of what was happening in someone's mind at the precise moment of the offence, and that gap is where many cases are won or lost.
4. Why the Defence Fails More Often Than It Succeeds
Malaysian courts, including in the Shalima Bi case below, have said plainly that the test under Section 84 is "a legal test and not a medical test." Judges, not psychiatrists, make the final call.
That produces some counterintuitive results. In Lee Ah Chye v PP [1963] MLJ 347, a claim of hallucinating a snake was rejected for lack of medical support. In PP v Rozman bin Jusoh & Anor (1995), the court held a low IQ alone doesn't amount to unsoundness of mind. Having a genuine, documented mental illness is not the same as meeting the legal test — the question is always whether, at that specific moment, the accused's mind could grasp the nature or wrongness of the act. There's no published success rate for Section 84 in Malaysia, but legal commentary consistently describes success as the exception, and courts have held they should consider unsoundness of mind even where the defence lawyer doesn't raise it (PP v Ismail bin Ibrahim, 1998).
5. If It Succeeds, You're Not Free — You're Detained "At His Majesty's Pleasure"
Where a court finds unsoundness of mind at the time of the offence, Section 347 of the Criminal Procedure Code requires the judgment to record that finding and state whether the accused actually did the act — the difference between "he didn't do it" and "he did it, but wasn't criminally responsible."
Section 348 then takes over. A successful unsoundness-of-mind defence isn't an acquittal in the way most people picture it — it converts a criminal trial into an indefinite civil commitment. The accused is ordered into "safe custody", almost always at a psychiatric hospital, held "during the pleasure" of the Agong (Federal Territories) or the state Ruler or Yang di-Pertua Negeri (states). That's exactly what happened to Safiq Rosli: found not criminally responsible, then sent straight to Hospital Bahagia Ulu Kinta with no discharge date fixed.
6. How Long Do People Actually Stay Locked Up?
There is no sentence, no statutory maximum, and no automatic release date attached to a Section 348 order. Interviewed by Malay Mail after the Safiq Rosli case, Universiti Malaya criminologist Dr Haezreena Begum Abdul Hamid put it bluntly: "How long will they stay in a mental hospital? This we don't know." Former Malaysian Bar president Salim Bashir Bhaskaran said such individuals "may still be detained for the rest of their lives in a mental hospital."
Release requires medical certification that the person has recovered and no longer poses a danger, and ultimately sits with the Agong or the relevant Ruler's discretion. There's no fixed term and no guaranteed exit — legal practitioners themselves say nobody can tell a family in advance how long detention will last. Hospital Bahagia Ulu Kinta, the country's oldest psychiatric hospital (opened 1911 as the Federal Asylum in Tanjung Rambutan), is one of a handful of government hospitals gazetted for forensic assessment and custody, and as of early 2024 had well over 1,000 warded patients, including a dedicated male forensic ward running supervised work programmes for around 48 long-stay patients.
7. Unsound Mind at the Time of the Offence vs Unfit to Stand Trial
These get confused constantly, but they're answered at different stages by different tests. CPC Sections 342 to 345 ask whether an accused is fit to be tried right now — can they understand the charge and instruct a lawyer. If a court suspects otherwise, it can remand the person for psychiatric observation and postpone the trial. Section 84, by contrast, is decided only after a full trial, asking what was happening in the accused's mind at the time the offence was committed — potentially months or years earlier.
Being "fit to stand trial" today and being "of unsound mind" when the offence happened are two separate legal questions, decided at different stages, and answering one tells you nothing about the other. In an ongoing 2025 school stabbing case now being tried in 2026, a psychiatric assessment at Hospital Bahagia Ulu Kinta found the accused, a minor, fit to stand trial — which says nothing about what the trial itself must still determine about his state of mind at the time of the act.
8. How This Has Actually Played Out in Malaysian Courts
The clearest illustration of how unsettled this area can get is Public Prosecutor v Shalima Bi. The accused, with a documented history of severe psychotic depression and electroconvulsive therapy dating back to 2004, attacked her husband's first wife with hot oil, causing serious burns. The High Court acquitted her on grounds of unsoundness of mind. The Court of Appeal disagreed, found only a personality disorder, convicted her and imposed the death sentence. The Federal Court then reinstated the acquittal, holding she had indeed been of unsound mind at the time. Three courts looked at the same psychiatric history and reached three different conclusions, with a life hanging on which one was final.
Not every case is that dramatic, but the defence has succeeded elsewhere on strong, consistent evidence — in PP v Muhammad Suhaimi Abdul Aziz [2004] 1 CLJ 378, psychiatric evidence of unsoundness of mind in the killing of the accused's wife went unrebutted by the prosecution. What links successful cases is documented medical history stretching back before the offence, not a diagnosis produced afterwards.
What to actually do
If a family member has just been arrested and has a history of mental illness:
- Tell the investigating officer and the duty lawyer immediately, ideally in writing, and ask early for a psychiatric referral.
- Gather medical records, hospital admissions and medication history now — evidence close to the offence carries more weight than anything reconstructed later.
- Get a criminal lawyer involved early; Section 84 cases are specialist, evidence-heavy litigation.
If the case has been charged and is ongoing:
- The court can order assessment at a gazetted hospital under CPC Section 342 — Hospital Bahagia Ulu Kinta and several state hospitals do this work.
- A finding of "unfit to stand trial" only pauses the case; it doesn't decide guilt.
- Ask whether the lawyer is running a fitness-to-plead argument, a Section 84 defence, or both — they rest on different evidence.
If a family member has been found of unsound mind and is now detained:
- Ask the hospital's forensic team what the review process looks like, and what "recovery" needs to look like on paper.
- A petition for release goes through medical certification and the Agong or relevant Ruler's discretion — a lawyer can help prepare this.
- This can be a long wait, sometimes years. Get support for yourself too — Talian HEAL 15555 supports families, not just patients.
On cost: The Legal Aid Department (Jabatan Bantuan Guaman) and the National Legal Aid Foundation (Yayasan Bantuan Guaman Kebangsaan) provide free or subsidised lawyers for accused people who can't afford one, including serious criminal cases. The Malaysian Bar's Legal Aid Centre (+603-2050 2050) can point you to your nearest centre. Court-ordered assessment is usually free; a private second opinion costs money but can strengthen a case.
FAQ
Can you fake or exaggerate mental illness to avoid a conviction?
Courts weigh conduct before, during and after the offence, so planning or lying to police cuts against a claim, and a fabricated story (like the "Jimmy told me to do it" defence rejected in John Nyumbei) tends to unravel under cross-examination.
What's the difference between "unsoundness of mind" and "diminished responsibility"?
Malaysia has no general "diminished responsibility" defence that reduces a charge, unlike some other countries — Section 84 is closer to all-or-nothing, though lesser mental disturbance can sometimes still be raised at sentencing.
Does succeeding mean you avoid punishment entirely?
You avoid a conviction, but not necessarily loss of liberty — under CPC Sections 347–348 you can be committed to a psychiatric hospital indefinitely, in real cases longer than a prison sentence would have run.
How long do people actually stay at Hospital Bahagia Ulu Kinta?
There's no fixed term and no published average. Legal experts say release depends on medical certification of recovery plus the Agong or relevant Ruler's discretion, and detention can, in principle, last a lifetime.
Can a psychiatric diagnosis alone win the case?
No. Malaysian courts have repeatedly held the test under Section 84 is legal, not medical, and have rejected the defence even where genuine illness was documented.
What happens if you're ruled unfit to stand trial, rather than found not guilty by reason of unsoundness of mind?
The case is paused, not dismissed. You may get bail with conditions or be referred for treatment, and the trial resumes once you're found fit — a separate track from a Section 84 defence, decided only after a full trial.
Does the defence apply to every crime, including minor offences?
In principle Section 84 applies to any Penal Code offence, but it's overwhelmingly raised in serious cases, because that's where the cost of running it is justified.
Can either side appeal?
Yes. Both prosecution and defence can appeal a finding on unsoundness of mind, and cases have gone all the way to the Federal Court, with different courts reaching different conclusions on identical facts, as in Shalima Bi.
This article is general legal information, not legal advice, and reading it does not create a lawyer–client relationship.
This article is general legal information, not legal advice, and reading it doesn't create a lawyer-client relationship with asklegal.my. The unsoundness-of-mind defence is one of the most fact-heavy, expert-dependent areas of Malaysian criminal law — outcomes turn on the specific psychiatric evidence and the individual judge, and genuinely similar facts have produced different results at different court levels, as Shalima Bi shows. Practice at Hospital Bahagia Ulu Kinta can also change administratively without any change to the underlying law, so treat anything here about detention length as a general description, not a guarantee. If you or a family member are facing this, you need a lawyer and a psychiatrist, not a website.
Spot something outdated or wrong? Tell us — we’ll verify and correct it, with the correction noted.
Key sources (11) — how this was verified
- Penal Code (Act 574), Section 84 — full statutory text of the unsoundness-of-mind provision: https://www.burgielaw.com/resources/act?act_title=Penal+Code§ion=84
- Criminal Procedure Code (Act 593), official reprint — primary text of the Act, including the Part XLV provisions on unsoundness of mind (ss.342-348): https://ccid.rmp.gov.my/Laws/Criminal_Prosedure_Code_Act_593.pdf
- MyLawyer.com.my, "Criminal Procedure Code Part 3" — plain-language breakdown confirming CPC section numbering and effect for ss.342 (procedure where accused suspected of unsound mind), 343 (Medical Director's certificate), 344 (release pending trial), 345 (resumption of trial), 347 (judgment of acquittal on ground of mental disorder) and 348 (safe custody/detention at the Ruler's pleasure): https://www.mylawyer.com.my/criminal-procedure-code-part-3/
- Malay Mail, 17 January 2024, "In Malaysia's first stalking case, court rules man to be detained at His Majesty's pleasure" — the Mohamad Safiq Rosli case: Section 84 and CPC ss.347/348 applied, detention at Hospital Bahagia Ulu Kinta: https://www.malaymail.com/news/malaysia/2024/01/17/in-malaysias-first-stalking-case-court-rules-man-to-be-detained-at-his-majestys-pleasure/112901
- Malay Mail, 21 January 2024, "Experts on what it means to be detained at His Majesty's pleasure" — legal expert commentary (Haezreena Begum Abdul Hamid, Geethan Ram Vincent, Salim Bashir Bhaskaran) on the lack of a fixed detention term and the release/review process: https://www.malaymail.com/news/malaysia/2024/01/21/experts-on-what-it-means-to-be-detained-at-his-majestys-pleasure-after-first-man-charged-with-stalking-acquitted/113401
- Malacca Bar Committee, K. Segaran, "Defence of Insanity in Malaysia: PP v Shalima Bi – Case Commentary" — full High Court/Court of Appeal/Federal Court history of the Shalima Bi case and the "legal test, not medical test" principle: https://malaccabar.org/archives/23134
- LoyarBurok, "The Insanity Defence in Malaysia" (3 May 2014) — M'Naghten origins, elements of Section 84, and case references including PP v Ismail bin Ibrahim (1998) and PP v Rozman bin Jusoh & Anor (1995): https://www.loyarburok.com/2014/05/03/insanity-defence-malaysia/
- Singapore Journal of Legal Studies (December 2008), "The Insanity Defence in the Criminal Laws of..." — comparative analysis of Malaysia, Singapore and India's shared Indian Penal Code-derived Section 84, confirming its cognitive-only, M'Naghten-based scope: https://law1a.nus.edu.sg/sjls/articles/SJLS-Dec-2008-241.pdf
- The Star, 19 January 2024, "Modern outlook for Hospital Bahagia Ulu Kinta" — current patient numbers, forensic ward details (including the 48-patient male forensic work programme) and treatment approach: https://www.thestar.com.my/news/nation/2024/01/19/modern-outlook-for-hospital-bahagia-ulu-kinta
- Wiki Impact, "Tanjung Rambutan: A Legacy Left Behind As Malaysia Improves In Mental Health Services" — Hospital Bahagia Ulu Kinta's institutional history from 1911 and current capacity: https://www.wikiimpact.com/tanjung-rambutan-a-legacy-left-behind-as-malaysia-improves-in-mental-health-services/
- Malay Mail, 17 July 2026, report on the Bandar Utama school stabbing trial — psychiatric fitness-to-stand-trial assessment at Hospital Bahagia Ulu Kinta, used here to illustrate the distinction from a Section 84 defence: https://www.malaymail.com/news/malaysia/2026/07/17/bandar-utama-school-stabbing-trial-to-hear-evidence-from-three-child-witnesses-under-special-safeguards/227998