TOKYO — Japan’s wartime emperor, Hirohito, was anguished right up until his death about his responsibility in World War II, according to a newly examined diary by one of his close aides.

The diary of the imperial chamberlain Shinobu Kobayashi, borrowed from his family and analyzed by the Kyodo News Agency, showed that the emperor was ruminating about how much people blamed him for the atrocities of World War II and the preceding Sino-Japanese War.

In an entry from April 7, 1987, just under two years before the emperor died at 87, Mr. Kobayashi recorded Hirohito as saying he had “been told about my war responsibility” and did not see any point in living longer because it would “only increase my chances of seeing or hearing things that are agonizing.”

Hirohito, the last emperor to be regarded as a deity by the Japanese people, was not among the thousands of Japanese military leaders prosecuted for war crimes. Although the Japanese waged the war in Hirohito’s name, Gen. Douglas MacArthur, the Allied powers’ supreme commander during the postwar occupation of Japan, helped shape a narrative that absolved the emperor of direct responsibility for the war.