The Duke of Cambridge has called on the UK and Ireland to work to maintain the bonds of friendship post-Brexit – and vowed the royal family will play its part.

William said relationships between people were “more essential” than legal treaties and he was optimistic a “shared vision for a peaceful and prosperous future” would ensure the “precious bond” between the Irish and the British was not broken.

The duke’s comments came in a keynote speech in Dublin and were echoed earlier in the day by agriculture minister Michael Creed, who said Ireland’s mission was to have “a very close relationship with the UK”.

The Duke and Duchess of Cambridge on a cliff walk during a visit to Howth Head in Co Dublin
The Duke and Duchess of Cambridge on a cliff walk during a visit to Howth Head in Co Dublin (Chris Jackson/PA)

William and Kate are on a three-day visit to Ireland and spent the day cooking lunch for young people after taking them food shopping, enjoying a scenic clifftop walk outside Dublin and touring a research farm.

Speaking at the Museum of Literature Ireland, at an event hosted by the Tanaiste, or deputy prime minister, Simon Coveney, the duke said: “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 went on to say: “Ladies and gentlemen, legal treaties are vital in underpinning the relationships between states.

“But relationships between people are equally, if not more essential – especially between the people of our two countries, whose lives, histories and futures are so deeply intertwined.

“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.”

The duke also urged the UK and Ireland not to be “bound” by the wrongs of the past in his speech, which mirrored the Queen’s historic address to the Irish people.

William highlighted the importance of reconciliation, just as his grandmother did during her 2011 Ireland visit when she offered her sympathy to everyone who had suffered in centuries of conflict between the two nations.

The Queen helped put Anglo-Irish relations on a firmer footing by her Irish tour and the Prince of Wales has sought to strengthen those ties by making five successive trips to Ireland over the past five years.

The Duke and Duchess of Cambridge during a visit to Extern at Savannah House in Co Meath, near Dublin
William and Kate during a visit to Extern at Savannah House in Co Meath, near Dublin (Stephen Lock/PA)

After the Cambridges had visited the research farm in Co Meath, Mr Creed said: “We may have gone our separate ways in our previously shared membership of the European Union, but I think we can forge a new economic and political dispensation that is reflective of those broad family ties that have been there for many, many years.”

He added: “The UK will always be our closest neighbour, our closest trading partner and we are anxious to maintain that.”

Speaking about the Cambridges, he said: “They are very, very welcome here. They bring a symbolic message as well to the island of Ireland. It’s power, it’s a symbolism, this is an island we can share.”

During their visit to the Teagasc Research Farm, William and Kate told the principal of a local primary school they wanted to return to Ireland as a family.

Eileen O’Reilly, head of the Kiltale National School, said after the couple had met some of her pupils: “They said they would like to come back here with the kids and do a cycling tour and see the Irish countryside.”

As he toured the farm William, who enrolled on a 10-week agricultural course in 2014, also revealed he had been inspired by his father to lay hedgerows to improve the countryside.

The Duke and Duchess of Cambridge visit Ireland – Day 2
Duke and Duchess of Cambridge visiting a Londis supermarket in Prosperous (Julien Behal/Department of Foreign Affairs and the British Embassy/PA)

Later the Cambridges helped prepare the dish of the day for a group of youngsters – after popping to a shop to teach the children about budgeting.

William and Kate joined 13-year-olds Simon and Molly at Savannah House, a respite centre run by social justice charity Extern in Clane, County Kildare, and then visited a nearby village shop to buy ingredients for vegetable soup – with 20 euro (£17) to spend.

Their trip to the Londis store in Prosperous, County Kildare, was supposed to be a secret but word had got out and around 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.”

The Duke and Duchess of Cambridge visit Ireland – Day 2
William and Kate during their hilltop walk (Chris Jackson/PA)

William and Kate also enjoyed a romantic clifftop walk when they spent some quality time together outside Dublin.

Walking hand-in-hand and with the stunning coastline as a backdrop, they strolled along a path on the Howth peninsula under blue skies.

At the end of their ramble the couple were met by Ireland’s environment minister Richard Bruton, who said: “They remarked on how you couldn’t come to Ireland and not see the coastline, so they got their wish.

“And they saw it in a benign light, normally there is a wind howling – it’s really beautiful today, they couldn’t be luckier.”