The act of
seppuku, ritual self disembowelment, began with Minamoto Tametomo and Minamoto Yorimasa in the latter part of the 12th century in the
Kamukura era. There are three classical kinds of seppuku. The term "
hara-kiri" which is popular in the West is not in common
Japanese usage as it means "belly cut" or "gut cut". This would be like saying that someone who died out of a sense of taking responsibility (no matter how deeply misguided) has "gone tits up". Not so respectful of the person's intentions.
Junshi: Suicide in order to follow one's lord into death. Quite common in the days of open warfare, junshi was banned in the Edo era as wasteful. The last famous example was that of the General Nogi Maresuke in 1912 following the death of the Emperor Meiji.
Kanshi: Suicide as remonstration. Not common, this involved killing one's self in order to make a point to a lord when all other forms of persuasion had failed. For example, Hirate Nakatsukasa Kiyohide, commited suicide to make a youthful and highly irreverant Oda Nobunaga change his ways. I suppose Yukio Mishima's botched attempt might count.
Sokotsushi: Here, a samurai would kill himself as a way of making amends for some transgression. This is possibly the best-known reason for seppuku, and has perhaps been popularized far out of proportion to its frequency. One well-known instance involves the Takeda general Yamamoto Haruyuki, who flung himself into the enemy after his plans had put his lord Shingen Takeda into danger. Badly wounded, he then commited seppuku.