Belfast should be an example to the world of people overcoming differences, the Queen has said.
In a speech at the City Hall, the Queen said she and the Duke of Edinburgh were seeing first-hand how people in Northern Ireland are working together for the common good.
"I know there are many challenges ahead and peacemaking is not always an easy task," she said.
"But you have come this far by turning the impossible into the possible; and, as you face the future and difficulties that may appear insurmountable, always remember that the thoughts and prayers of millions, including my own, are with you."
The Queen added: "The world yearns for examples of positive transformation and of people overcoming differences.
"I hope and believe that Belfast will continue to be one such living example, and I want to thank you - all of you - from every part of this city for the hard work and dedication which you and your families have given to help reshape the city of Belfast and the lives of all the people who live here."
The Queen gave the short speech at a special banquet in her honour after visiting Crumlin Road Gaol with Stormont First Minister Peter Robinson and Deputy First Minister Martin McGuinness - both of whom spent time in the cells in the 1970s or '80s.
She also visited the sets at the Titanic studios, where the global television hit Game Of Thrones is filmed.
It is the first time for almost 50 years that the Queen has been in City Hall.
She was warmly welcomed by hundreds of well-wishers outside while a tight security cordon was in place right around the city centre.
At City Hall, she met Nichola Mallon, SDLP Lord Mayor of Belfast, and Peter McNaney, chief executive of Belfast City Council.
The royal visitors also enjoyed pre-lunch drinks with elected members of the council.
The Queen and Philip also signed the visitors' book in the Marble Hall.
"Much has happened since I was last in the City Hall," she said. "We have learnt a lot in those years about ourselves, each other, and how societies can only grow and flourish if they are built on trust, respect, justice and inter-dependence.
"On our visit, Prince Philip and I have seen something of the constructive ways in which the people of this city are working together to serve the common good, and we have observed at first-hand how Belfast can attract prominent investors thereby creating high value jobs."
The Queen said she was certain that in another 50 years a new generation will be in City Hall - the grandchildren and great-grandchildren of this generation - to look back together and see a place which has been further transformed.
She said they would see the words of her grandfather George V fully realised.
In 1921, at an address at the City Hall, the King asked "to stretch out the hand of forbearance and conciliation".
The royal visit continues later today with a garden party at Hillsborough Castle.
The Queen wore an Angela Kelly lemon light wool tweed coat with silver and black thread running through it and a silk lemon dress with floral designs.
Her hat, also by Angela Kelly, was lemon tweed and wool adorned with petals.