"Yes, there have been differences between America and Europe," he said, "But the burdens of global citizenship continue to bind us together. A change of leadership in Washington will not lift this burden. In this new century, Americans and Europeans alike will be required to do more -- not less. Partnership and cooperation among nations is not a choice; it is the one way, the only way, to protect our common security and advance our common humanity."
Obama added: "That is why the greatest danger of all is to allow new walls to divide us from one another."
The presumptive Democratic nominee argued terrorism is the common threat both Europeans and Americans share.
"The fall of the Berlin Wall brought new hope. But that very closeness has given rise to new dangers -- dangers that cannot be contained within the borders of a country or by the distance of an ocean," he said. "The terrorists of September 11th plotted in Hamburg and trained in Kandahar and Karachi before killing thousands from all over the globe on American soil.
The speech came after a meeting between Obama and German Chancellor Angela Merkel, in which they discussed the wars in Iraq and Afghanistan as well as climate and energy issues at Germany's chancellery.
They also discussed Pakistan, the Middle East peace process, the trans-Atlantic economic partnership, the global economy and "the need for cooperation on the international level and in international organizations to solve important global questions," a Merkel aide said.
Stakes were high going into Obama's planned speech in Berlin after a near-perfect overseas trip that many have tamped down fears of how Obama would handle U.S. foreign policy.
In advance of the speech, Obama told reporters: "Hopefully it will be viewed as a substantive articulation of the relationship I would like to see between the United States and Europe...I am hoping to communicate across the Atlantic the value of that relationship and how we need to build on that."
Obama flew to Berlin from the Middle East, where he had toured Jerusalem and met with Israeli and Pakistani leaders.
Closing his evening speech before a throng of Europeans who had gathered to see him, Obama said, "People of Berlin -- and people of the world -- the scale of our challenge is great. The road ahead will be long. But I come before you to say that we are heirs to a struggle for freedom. We are a people of improbable hope. Let us build on our common history, and seize our common destiny, and once again engage in that noble struggle to bring justice and peace to our world."
But even as Obama was greeted by enthusiasm overseas, not all were heeding the call at home, where the candidate will face voters in November.
"What has upset me is that he is over there acting presidential ... I don't want him over there representing me," Columbus, Ohio, resident Diane Woods said during McCain's visit.
"I don't know why Obama's getting all this attention," she said, "McCain is right where he should be -- in America."
ABC News' David Wright contributed to this report.