Teenagers clutched camera phones as he was introduced on stage by wife Michelle Obama, who told the audience of youngsters that they should set their sights high.
Fifteen years after the signing of the Good Friday peace agreement which cleared the way for the power-sharing executive in Belfast, the US president said the world was watching for the next stage of the process.
In a speech at the Belfast’s Waterfront Hall, he said: ‘The terms of peace may be negotiated by leaders, but the fate of peace is up to you.’
David Cameron, Northern Ireland’s First Minister Peter Robinson and Deputy First Minister Martin McGuinness last week announced plans to demolish so-called ‘peace walls’ in Northern Ireland within 10 years.
President Obama backed an end segregated schools and housing.
He said: ‘If towns remain divided – if Catholics have their schools and buildings and Protestants have theirs, if we can’t see ourselves in one another and fear or resentment are allowed to harden – that too encourages division and discourages cooperation.’
He added: ‘Peace is not just about politics. It is about attitudes, a sense of empathy and breaking down barriers in hearts.’
Mr Obama acknowledged the challenges that exist. He said: ‘There are still people who have not reaped the rewards of peace, there are those who are not convinced that the effort is worth it.
‘There are still wounds that have not been healed and communities where tension and mistrust hangs in the air. There are walls that still stand, there are still many miles to go.’
He said it was within his audience’s power to change that. ‘Whether you are a good neighbour to someone from the other side of past battles, that is up to you,’ he warned.
‘Whether you treat them with the dignity and respect they deserve, that is up to you.
‘Whether you let your kids play with kids who attended a different church…that is up to you.’
After the speech for Obama travelled to the Lough Erne resort in Enneskillen for the G8 summit.
He is expected to launch formal talks on a new trade deal between the US and Europe.
But the two-day meeting is expected to be dominated by global divisions over Syria.
Mr Obama is ready to arm opposition forces but Russian President Vladimir Putin used a press conference in Downing Street yesterday to warn the rebels ‘eat the organs’ of their enemies.
Mr Obama made no reference in his speech to Syria, but suggested the resolution of the conflict in Northern Ireland was a ‘blueprint’ to bringing about peace to other countries.
He said: ‘You need to get this right. You set the example for those who are seeking peace to end conflicts of their own.
‘You are their blueprint to follow. You are the proof of what is possible. Hope is contagious. They are watching to see what you do next.’
The two-day G8 summit will see the Lough Erne resort in Enniskillen host Mr Obama, Mr Putin, German Chancellor Angela Merkel, French President Francois Hollande, Canadian premier Stephen Harper, Italian Prime Minister Enrico Letta and Japan’s Prime Minister Shinzo Abe.
Syria is likely to dominate the agenda, with attendees as far away from agreement as ever.
In a round of TV interviews at Lough Erne, David Cameron said: ‘Let’s be clear – I am as worried as anybody else about elements of the Syrian opposition, who are extremists, who support terrorism and who are a great danger to our world.
‘The question is what do we do about it? My argument is that we shouldn’t accept that the only alternative to Assad is terrorism and violence.
‘We should be on the side of Syrians who want a democratic and peaceful future for their country and one without the man who is currently using chemical weapons against them.
‘What we can try and do here at the G8 is have further pressure for the peace conference and the transition that is needed to bring this conflict to an end.’