Seppuku (also called hara-kiri) is a ritual and honorable suicide with Japanese origins. It came to be a key part of bushido, the code of the samurai warriors. Traditionally, it is done by cutting open one's abdomen with a wakizashi, with one deep cut down into the left side, and a rolling slice across--thereby releasing the soul.
A slightly less honorable version (and much less painful) is that at the same time, a second (called kaizoe or kaizoe-nin) severs the head for an instant death. To distinguish the decapitation from a common execution, a trusted and skilled samurai was chosen to strike the blow, from behind, leaving the head attached to the body by a flap of skin at the front of the neck. The second was usually but not always, a friend; e.g. if a warrior had fought honourably and well but lost, an opponent who wanted to salute his bravery would volunteer to act as his second.
Seppuku was traditionally used as the ultimate protest when one's own morals stood in the way of executing an order from the master. It was also permissible as a form of repentance when one had committed an unforgivable sin, either by accident or on purpose. Finally, in the feudal period (1190-1867) it was the form of punishment preferred in cases where the subject required an honourable, but necessary, death sentence, such as the 47 Ronin.
There is a great deal of ritual associated with seppuku, particularly when it was done as a protest, or as an honourable punishment. In such cases it might be performed in a spiritually clean temple or similar location, but other locations (e.g. on the field of battle, for members of the losing side) were also common.
Being an extremely difficult and painful way to die, especially without the assistance of a trained second (who may held liable for murder), seppuku is all but obsolete in modern Japan. A notable exception was author and right-wing activist Yukio Mishima, who committed public seppuku at the Japanese Self-Defence Forces HQ after an abortive coup in 1973.
In Japanese, hara kiri (腹切り) is a slang term: literally, "belly slashing". The formal term for honorable suicide, which should be used unless one is deliberately trying to be insulting, is seppuku (disembowelment) (切腹).
See also: Kamikaze