In the final year of the war, the Allies prepared for what was anticipated to be a very costly invasion of the Japanese mainland. The war in Europe had concluded when Nazi Germany signed its instrument of surrender on May 8, 1945, just after Hitler committed suicide. The Japanese, facing the same fate, refused to accept the Allies' demands for unconditional surrender and the Pacific War continued.
This put the US in a bad spot, either storm the beaches of japan and lose many more us soldiers, or use the atomic bomb that was being worked on under the name the Manhattan Project. The plan with the atomic bombs was to destroy 4 major cities in the japan to make them retreat but also send a message to Russia that the US was the first to complete the nuclear bomb.
However the united states and many of their alies did not want to use the bomb but rather wanted to japan to surrender. The Allies called for the unconditional surrender of the Japanese armed forces in the Potsdam Declaration on July 26, 1945—the alternative being "prompt and utter destruction". The Japanese response to this ultimatum was to ignore it.
Orders for atomic bombs to be used on four Japanese cities were issued on July 25. On August 6, the U.S. dropped a uranium gun-type (Little Boy) bomb on Hiroshima, and American President Harry S. Truman called for Japan's surrender, warning it to "expect a rain of ruin from the air, the like of which has never been seen on this earth." Three days later, on August 9, a plutonium implosion-type (Fat Man) bomb was dropped on Nagasaki.
Within the first two to four months of the bombings, the effects of the atomic bombings killed 90,000–146,000 people in Hiroshima and 39,000–80,000 in Nagasaki; roughly half of the deaths in each city occurred on the first day. During the following months, large numbers died from the effect of burns, radiation sickness, and other injuries, compounded by illness and malnutrition. In both cities, most of the dead were civilians, although Hiroshima had a sizable military garrison.