For most of the war, Anami served in a combat role, first in central China, then Mancuria and finally in western New Guinea, before being recalled to Japan late in 1944. In April 1945 he became Minister of War in the Suzuki cabinet.
Anami was a member of the "fight to the death" faction in the Japanese government, convinced that a determined defence of the Japanese home islands would force the Allies to agree to the Japanese terms for an end to the war, and avoid a military occupation of Japan. This attitude made him a focus for the plotters of the military coup of 14-15 August 1945, who expected him to lead or at least support their efforts to overthrow the government and repudiate the Japanese surrender.
Anami himself was unwilling to support any attempt to overthrown the authority of Emperor Hirohito, who had directly requested an end to the war. On 14 August Anami signed the surrender document, and refused to support the coup. His attitude was one of the reasons the coup attempt failed, for only one senior officer would support it against the authority of the war minister. By the next morning the attempted coup had failed and on 15 August Anami himself commited suicide shortly before the Emperor made his surrender broadcast.