Vice-President Joe Biden has expressed his regret at the British majority vote to secede from the European Union but he pledged at the same time that the US would continue to maintain its very good relations with both the United Kingdom and the EU.

The Vice-President mentioned the referendum vote at different events in Dublin. The first was a ceremony in Trinity College and the second was a public address he gave to a large crowd at Dublin Castle.

In his address at Trinity College, he said: "We would have preferred a different outcome. And I imagine many of you here felt the same way." But he went on to re-affirm the continuing friendship of the United States with both the UK and EU.

At Dublin Castle, he said: "As longstanding friends of the United Kingdom the United States respects their decision. It's not how we would have preferred it to be, but respect their position."

"Our relationships with the United Kingdom and our allies across Europe are indispensable for America's economic as well as national security.

"So, as the leadership in London and Brussels determines what this new relationship will look like we will continue to work with our partners to navigate a new road ahead while continuing to promote stability, security and prosperity around the world."

He was preceded at the Dublin Castle event by the Irish Taoiseach (Prime Minister) Enda Kenny who said Mr Biden was "a truly outstanding son of Ireland".

He added that, "for his entire political life, Vice-President Biden has been in the forefront in leading America on key civil rights and societal changes. I applaud his determination and his leadership to combat domestic and sexual violence, gun crime and his stand for marriage equality".

Kenny pointed out that, just over a year before, the passage of the Irish constitutional referendum to legalize same-sex marriage had been celebrated at the same location of Dublin Castle.

Irish and American flags were distributed to the crowd of about 2,000 members of the public prior to the Biden speech and a recording of U2's "Beautiful Day" was played on the loudspeakers as he approached the microphone.

He quipped that the Taoiseach was "going to be so happy when I go home" because Kenny had been with him virtually on a "24/7" basis.

He recalled that, a few days earlier, three generations of his family had walked along the street in Ballina, County Mayo - "a town that once was home to my great-great-great-grandfather Edward Blewitt and his son Patrick, my great-great-grandfather".

In 1851, Patrick and his family had sailed to the US via Liverpool on a ship called the Excelsior. As they walked together in Ballina, his descendants wondered "what it must have been like to leave everything behind".

They imagined the "American Wake" that must have taken place: "The last time you'd see your family, your friends, the soil that you loved".

The Vice-President said that, next day, he and his relatives would make a similar trip to the Cooley Peninsula in County Louth where another Irish branch of the family originated: "We'll visit the church where my great-great-grandfather Owen Finnegan and his family were baptized.

Neither the Blewitts nor the Finnegans ever forgot where they came from: "Every time I walked out the door, my Grandfather Finnegan would say, 'Joe, remember, the best drop of blood in you is Irish'. He'd never been to Ireland!"

In Scranton, Pennsylvania in 1909, his grandparents Ambrose Finnegan and Geraldine Blewitt met and married. He said that pride in their Irish roots "has been passed down in every generation in our family".

On the links between Ireland and the US, he said: "Everything between us runs deep, literature, poetry, sadness and joy, but most of all resilience.

"Despite everything, we've never stopped being dreamers. I think the Irish are the only people in the world who are actually nostalgic about the future!"

He criticized "reactionary politicians and demagogues" who fomented public sentiment on mass migration: "We see it in Europe, we see it in other parts of the world and we see it in my home country, where some politicians find it convenient to scapegoat immigrants instead of welcoming them, to play to our fears rather than, as Abraham Lincoln said, 'appeal to our better angels'."

Sounds like Joe Biden is taking on Trump at Dublin Castle pic.twitter.com/96VkL68iiP

— Jackie Fox (@jackiefox_) June 24, 2016

Biden highlighted the participation of the US and Ireland "in the 66-nation coalition" to defeat and ultimately destroy ISIL. Ireland and the US were also working to address "the largest humanitarian and refugee crisis since World War Two".

Closing, he thanked the 2,000-strong crowd for their welcome and, finishing on a humorous note, he said: "I don't know why the hell my ancestors ever left." Internationally-renowned group, The Chieftains were among the musicians who performed at the event which was compered by TV and radio presenter Ryan Tubridy.

Earlier in the day, the Vice-President was award an honorary degree as Doctor in Laws by Trinity College Dublin, said to be the first such degree he has received from a university outside the United States.

The degree, in recognition of his contribution to world politics, was presented by the university's Chancellor Mary Robinson, a former president of Ireland, in the presence of the Trinity Provost and President, Dr. Patrick Prendergast.

Biden was also presented with a gold medal by the Philosophical Society of the university, one of the oldest student debating societies in the world.

In his speech at the ceremony, the Vice-President informed Mrs Robinson, who also has Mayo roots, that as a result of genealogical research he had ascertained that the two of them were related: "I am not joking, we are distant cousins by marriage."

He said he was proud to join the ranks of Americans who had visited Trinity College, including President John F. Kennedy and his brother Senator Edward Kennedy, as well as Woodrow Wilson before he became president and, back in 1771, Benjamin Franklin.