In 1905, as part of his special theory of relativity, Albert Einstein published the point that a large amount of energy could be released from a small amount of matter. This was expressed by equation E=mc2 (energy equals mass times the speed of light squared). But bombs were not what Einstein had in mind when he published this equation.
In 1929, he publicly declared that if a war broke out he would "refuse to do war service, direct or indirect…" His position would change in 1933, as the result of Adolf Hitler's coming into power in Germany.
Einstein's greatest role in the invention of the atom bomb was signing a letter to President Franklin Roosevelt urging that the bomb be built because some physicists feared that Germany might be working on an atom bomb. Among those concerned were physicists Leo Szilard and Eugene Wigner. But Szilard and Wigner had no influence on those in power. So in July 1939 they explained the problem to someone who did: Albert Einstein. After talking with Einstein, in August 1939 Szilard wrote a letter to President Roosevelt with Einstein's signature on it, which was delivered to Roosevelt in October 1939.
Germany had invaded Poland the previous month; the time was ripe for action. That October the research of A-bomb began but proceeded slowly because the invention of the atom bomb seemed distant and unlikely. In April 1940 an Einstein letter, ghostwritten by Szilard, pressed the researchers on the need for "greater speed".
As the realization of nuclear weapons grew near, Einstein looked beyond the current war to future problems that such weapons could bring. He wrote to his friend about his fear about the future use of the A-bomb.
The atom bombings of Japan occurred three months after Germany gave in.
In November 1954, five months before his death, Einstein summarized his feelings about his role in the creation of the atom bomb: "I made one great mistake in my life…when I signed a letter to President Roosevelt recommending that atom bombs be made; but there was some justification—the danger that the Germans would make them."