The Duke of Cambridge has called on the UK and Ireland to maintain the bonds of friendship after Brexit, on the second day of his visit to the country.
The duke said relationships between people were "more essential" than legal treaties between states.
He urged the UK and Ireland not to be "bound by the wrongs of the past".
This is the Duke and Duchess of Cambridge's first official visit to the Irish Republic and they spent much of Wednesday talking to young people.
In tone and content, the duke's address at the Museum of Literature in Dublin was reflective of the Queen's comments on her historic visit to the Irish Republic in 2011.
He quoted his grandmother in saying the islands had "experienced more than their fair share of heartache and turbulence".
"Of course, the changing relationship between the UK and the EU will require us to work together, to ensure that the relationship between Ireland and the UK remains just as strong," he said.
"I am confident that friendship, understanding and a shared vision for a peaceful and prosperous future will ensure that the unique and precious bond between our people is not broken.
"My family is determined to continue playing our part in protecting, preserving and strengthening that bond."
Wednesday's engagements began with a visit to Jigsaw, the National Centre for Youth Mental Health, where they spoke to staff about their work at the charity's premises in Dublin's Temple Bar.
Their work is particularly close to Prince William's heart, having spoken in the past about his own struggles following the death of his mother.
Children and young people at the centre presented them with gifts.
Josh and Alba told BBC News NI it was a "surreal experience".
"We had a good discussion around the stigma of mental health," said Alba.
"They were so interested in what is done here and so lovely - I think they could have listened all day long," said Josh.
"They had to be ushered away."
By Jonny Dymond, BBC royal correspondent
This visit doesn't have the historic weight of the Queen's tour in 2011.
Nor is there the celebrity frenzy that sometimes surrounded Harry and Meghan when they came after their engagement was announced in 2018.
But solemnity there certainly was on Tuesday when the duke and duchess followed in the Queen's footsteps and paid their respects to the heroes of Irish independence at the Garden of Remembrance in central Dublin.
And at the less grandiose events on Wednesday, at organisations whose activities align with William and Kate's interests, the welcome has been warm.
On Wednesday night, the duke echoed his grandmother's words in 2011 when he addressed Britain and Ireland's shared history, its ups and many downs.
All small steps that build the relationship between Britain and Ireland.
James Barry, service manager at Jigsaw, said the couple were "warm and kind".
"They really wanted to hear about the experience of young people who've used the service," he said.
"I was fortunate enough to speak to Kate and she was really interested in young people's experiences from an early age and the importance of a parent role."
Earlier in the day, the duke and duchess visited Savannah House in County Kildare, a residential facility run by the charity Extern which supports young people with a range of issues from being homeless to dealing with drug and alcohol problems.
While there, they visited a nearby village shop to buy ingredients to make vegetable soup - with €20 (£17) to spend.
The trip to the store was supposed to be a secret but word got out and about 200 villagers had gathered to see them.
Store owner Philip Stynes admitted he had told a few customers about the impending visit and word soon spread.
"It just snowballed from there," he said.
"But even if we hadn't told them, there would have been a big crowd. People live out on the streets here."
While visiting Howth Marine Institute to learn about marine sustainability, the couple took the opportunity to stretch their legs at Howth Cliff, a popular walking path beside the Irish Sea.
Wednesday's itinerary also included a visit to the Irish Agriculture and Food Development Authority, known as Teagasc.
The royal couple's first day in the country began with a warm welcome from Irish President Michael D Higgins and his wife at their official residence, Áras an Uachtaráin.
As is traditional during visits of important guests, the duke and duchess rang the peace bell within the grounds of the estate.
They also met the caretaker taoiseach (prime minister) Leo Varadkar and his partner, Matthew Barrett, at government buildings in the city centre.