In the Hiroshima Peace Park guest book, Obama wrote: "We have known the agony of war. Let us now find the courage, together, to spread peace, and pursue a world without nuclear weapons."
Obama also said that scientific strides must be matched by moral progress or mankind is doomed.
Obama's visit is historic as it is the first visit by a sitting US president to Hiroshima. The atom bomb attack on Hiroshima on August 6, 1945, killed around 140,000 people. The dead included 20,000 Koreans who had been forced by the Japanese military to work in the city for the imperial war machine.
Three days after the Hiroshima bombing, a second atomic bomb launched by the US hit Nagasaki, killing a total of 80,000, including an additional 30,000 Koreans. Most of those killed in both cities were civilians.
On Friday, hundreds of people were present on the streets to welcome Obama as his motorcade entered the city. The presidential limousine pulled up behind the Peace Memorial Museum.
Obama also laid a wreath in front of the cenotaph. He bowed his head and stood silently for a minute. Abe then did the same. "We come to ponder a terrible force unleashed in a not-so-distant past," Obama said. The souls of the people who died in this city "speak to us," he added. "They ask us to look inward, to take stock of who we are and what we might become."