Short answer. Generally no. Under Article 12 of the Revised Penal Code, an insane person is exempt from criminal liability — unless he acted during a lucid interval. Instead of punishment, the court orders his confinement in a hospital or asylum, which he cannot leave without the court's permission.
What the law says
An imbecile or an insane person, unless the latter has acted during a lucid interval.
Revised Penal Code, Article 12 — Exempting Circumstances: Insanity, Accident And Minority. Read the full provision →
Insanity as an exempting circumstance
Article 12 lists circumstances that exempt from criminal liability, and the first is an imbecile or an insane person. The reason is that criminal liability rests on a free and intelligent will; a person who, because of insanity, could not understand the nature of his act or knew not what he was doing lacks the mental element the law requires for guilt. So an accused who was genuinely insane at the time of the act is not held criminally liable for it. This is an exemption from criminal responsibility, reflecting the principle that the law punishes only those capable of choosing to do wrong.
The lucid-interval exception
The exemption is not unconditional. The article withholds it from an insane person who has acted during a lucid interval — a period in which the person's reason returned and he was, at that moment, sane. If the crime was committed during such an interval, the ordinary rules of liability apply, because the actor then had the capacity to understand and control his conduct. This is why insanity is judged at the precise time of the act, not in general. A history of mental illness is not automatically a defence; what matters is the accused's actual mental state when the offence was committed, and whether reason had, however briefly, returned.
Exemption is not simply release
Being exempt does not mean the insane person walks free with no consequence. Article 12 provides that when such a person has committed an act which the law defines as a felony, the court shall order his confinement in one of the hospitals or asylums for persons so afflicted, and he shall not be permitted to leave without first obtaining the permission of the same court. So the outcome is treatment and safekeeping under judicial control, not punishment and not a simple discharge. The confinement protects both the public and the afflicted person, and the requirement of court permission to leave keeps the release decision in the hands of the court rather than the hospital alone.
A correction on the minority thresholds
Article 12 also contains age-based exemptions, and those figures are no longer the governing rule. The age thresholds printed in this article have been superseded by Republic Act No. 9344 (2006), as amended by Republic Act No. 10630 (2013). Under that law, a child who was fifteen years old or under at the time of the offence is exempt from criminal liability, and a child above fifteen but below eighteen is exempt unless he acted with discernment — with an exempt child undergoing an intervention or diversion programme rather than prosecution. The old juvenile procedure this article points to no longer exists. On insanity itself, though, the exempting rule and the confinement it requires remain as stated. Anyone facing a case where insanity is raised should seek counsel, since proving the mental state is demanding.