US President Barack Obama has said there is still much work to be done in Northern Ireland in order to secure a stable, peaceful future.
Barack Obama gave a rousing address to some 2,000 people - mostly young students - at Belfast's Waterfront Hall in what he said was "a different city".
"There is still much work to do," 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."
"There are walls that still stand, there are still many miles to go.
"No one was naive that peace would be anything but a long journey."
Mr Obama, who visited the Republic of Ireland in 2011 but was on his first trip north of the border, pledged America's continued support for Northern Ireland.
"For those who choose the path of peace, the United States of America will be with you every step of the way," he vowed.
"We will always be a wind at your back.
"As I said on our visit two years ago I am convinced that this little island inspires the biggest of things. This little island - its best days are yet ahead."
The president said no-one was naive enough to think peace would be anything other than a long journey.
"This work is as urgent now as it has ever been because there is more to lose now than there has ever been," he said.
Mr Obama travelled to Belfast with his wife Michelle and daughters Sasha and Malia. A massive policing operation surrounded the visit - part of the wider security efforts aimed a delivering a secure G8 summit at the Lough Erne Golf Resort in Co Fermanagh.
Peter Robinson and Martin McGuinness, the First and Deputy First Ministers of the Stormont power-sharing executive, greeted the president on arrival at the Waterfront and held a brief private meeting before Mr Obama's public address.
The First Lady introduced her husband on stage after herself being welcomed to the podium by 16-year-old Belfast schoolgirl Hannah Nelson.
Earlier, the Methodist College pupil delivered a powerful speech to the packed auditorium expressing hope that a permanent peace could be achieved.
Walking to the lectern to rapturous applause, Mr Obama told the audience Northern Ireland was a place of "remarkable beauty and extraordinary history".
In a speech dotted with touches of humour, arguably the biggest cheer came when the president employed the well-known local phrase "What's the craic?".
But the overall tone of the address was a serious one - issuing a challenge to the region's people, especially the younger generation, to not let the gains of peace slip and push for a better future.
"It is within your power to make change," he said.
"Whether you are a good neighbour to someone from the other side of past battles, that is up to you.
"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."
Noting the religious divisions that still exist in Northern Ireland society, Mr Obama suggested the time had come to address challenges such as separated schooling and housing.
"Issues like segregated schools and housing, lack of jobs and opportunity, symbols of history that are sources of pride for some and pain for others - these are not tangential to peace, they are essential to it," he insisted.
"If towns remain divided, it Catholics have their schools and buildings and Protestants have theirs, if we can't see ourselves in one another, if fear and resentment are allowed to hardened, that encourages division, it discourages co-operation.
"Ultimately, peace is not just about politics, it's about attitudes, it's about a sense of empathy, it's about breaking down the divisions we create for ourselves in our own minds and our own hearts that don't exist in any objective reality but we carry with us generation after generation."
Mr Obama acknowledged that there remained those who wanted to bring Northern Ireland back to its violent past.
"This peace in Northern Ireland has been tested over the past 15 years , it has been tested over the past year, it will be tested again," he said.
The president added: "Whenever your peace is attacked you will have to choose whether to respond with the same bravery that you have shown so far or whether you succumb to worst instincts, those impulses that kept this great land divided for too long.
"You will have to choose whether to keep going, forward rather than backward and you should know that as long as you are moving forward America will always stand by you as you do."
As Mr Obama was speaking at the Waterfront Hall a small number of protesting dissident republicans opposed to the Northern Ireland peace process - some masked - marched to Belfast City Hall from a nationalist area in the west of the city.
But they were quickly moved on by police into a neighbouring street where they were hemmed in on the footpath for almost an hour. A 19-year-old man was arrested for a number of offences including disorderly behaviour.
Ahead of Mr Obama's arrival, there was a real sense of excitement inside the Waterfront Hall where the crowd performed a Mexican wave as they waited.
Sinn Fein leader Gerry Adams, Police Service of Northern Ireland (PSNI) Chief Constable Matt Baggott, Olympic gold medal winner Dame Mary Peters and a number of Stormont ministers were among those taking part as the wave did laps round the hall.
Outside the conference centre, a small crowd of well-wishers gathered, hoping to catch a glimpse of the president and his family.
Air Force One had touched down at Aldergrove International Airport, 20 miles north of the city, at 8.35am amid one of the biggest security operations ever mounted in Northern Ireland.
Mr Obama emerged on the steps of the plane wearing his trademark crisp dark suit and clutching his youngest daughter's hand.
He was flown by Marine One helicopter to George Best Belfast City Airport and then travelled by road to the Waterfront Hall convention centre a mile away.
Hundreds of police 4x4s lined the streets, while the PSNI helicopter patrolled the skies over the city and specialist boat units kept watch from the River Lagan.
Thousands of extra police officers were deployed in the region ahead of the G8 summit, including 3,600 from forces in England and Wales.
Mr Obama said the success of the Northern Ireland peace process was important for the whole world as it encouraged others embroiled in conflict to seek another way.
"What happens here has an impact on lives far from here," he said.
"And if you continue your courageous path toward permanent peace and all the social and economic benefits that comes from it, that won't just be good for you, it will be good for this entire island, it will good for the United Kingdom, it will be good for Europe, it will be good for the world.
"We need you to get this right."
Former US president Bill Clinton became the first serving US leader to visit Northern Ireland in 1995 and was a regular visitor during the peace negotiations. George Bush also visited Northern Ireland in 2008.
Roads into and out of the city were closed to facilitate President Obama's visit.
Hundreds of police Land Rovers also lined the streets, while the PSNI helicopter patrolled the skies over the city.
Thousands of extra police officers have been drafted into Northern Ireland ahead of what is the region's biggest single security operation in its history.
Later today, Mr Obama and EU leaders are expected to launch negotiations on what has been dubbed an "economic Nato".
When talks conclude in 18-24 months' time, Mr Cameron believes the EU/US trade pact could be worth £10bn to the UK economy - or £380 for every British household.
He is also hoping to forge agreement on greater sharing of tax information in order to prevent companies and individuals avoiding paying their fair share by hiding cash in offshore bolt-holes.
At the weekend the tax transparency drive was boosted by the agreement of 10 British overseas territories and crown dependencies to sign up to new OECD standard.