On August 6, 1945, the United States dropped an atomic bomb on Hiroshima, Japan, killing approximately 80,000 people, injuring 35,000 more, and causing another 60,000 people to die slower deaths from the resultant radiation. Three days later, on August 9, 1945, the United States dropped another atomic bomb on the city of Nagasaki, Japan, killing another 40,000 people and injuring 60,000 more, plus causing many more lingering deaths from radiation. Until the second atomic bomb was dropped, Japan had held out against unconditional surrender. However, after the devastation of Nagasaki, attitudes changed. Emperor Hirohito announced Japan's unconditional surrender on August 15, and Japan formally surrendered on September 2, 1945.
The desire to defeat Japan was the overriding reason that President Truman decided to use atomic weapons, but it was not the only reason. Additionally, there were several options considered before the atomic bombs were dropped.
Despite the total defeat of Germany in Europe and Japan's losses in the Pacific, the Japanese leaders refused to surrender, even though it was obvious to them that they had no chance of winning. Air raids of Japan that resulted in hundreds of thousands of casualties had proven to be ineffective in bringing about surrender. One option was to continue to pursue these raids in preparation for a massive Allied land attack on the Japanese mainland.
However, judging by the way Japanese soldiers had protected relatively worthless islands in the South Pacific, US military leadership predicted great loss of life, possibly a million or more American casualties, if an assault on the mainland was attempted. US armed forces would be fighting not only the Japanese military, but also most likely civilians as well.
Another option that was considered was to drop an atomic bomb on a relatively uninhabited island as a demonstration of its power. However, it would have depleted a large portion of the US atomic arsenal on a demonstration which might not be effective. This proved to be a good point, as even when the first atomic bomb decimated a city, Japan did not agree to surrender.
The ultimate decision to drop the bombs was Truman's alone, and he did it mainly to bring a swift end to the war. However, there was one other important consideration. In early 1945 at the Yalta Conference, Soviet leader Joseph Stalin made known his intention to attack Japan if it did not surrender after the war in Europe was over. Although Soviet military assistance would be helpful in defeating Japan, Truman was concerned that the Soviets would expand into Asia as they had into Europe. He was intent on ending the war with Japan quickly to prevent this from happening.