A kaishakunin (Japanese: 介錯人) is an appointed second whose duty is to behead one who has committed seppuku, Japanese ritual suicide, at the moment of agony. The role played by the kaishakunin is called kaishaku (nin means person).
Aside from the purpose of being spared prolonged anguish until death, both the condemned and those on hand to observe are spared the spectacle of the writhing death throes that would ensue. The use of a kaishakunin is normally reserved for one who is performing the deed out of honor, rather than in disgrace. For example, a warlord who is defeated in battle and has chosen to commit seppuku might be appointed a second so that he may die respectably, as opposed to a samurai who has been ordered to die for some crime, or for having disgraced his clan through dishonorable deeds.
The most recent kaishakunin of the 20th century was Hiroyasu Koga, who beheaded the novelist Yukio Mishima during Mishima's seppuku.
Read more about Kaishakunin: The Ritual, Role As Executioner