US president Donald Trump has sought to reassure Ireland that Britain’s exit from the European Union (EU) will work out fine for its near neighbour.

Trump arrived in Ireland for the first time as US president on Wednesday.

Ireland’s Prime Minister Leo Varadkar used a meeting with the president, who has been a vocal supporter of Brexit, to underline Ireland’s concerns over the departure that could impact it more than any other country remaining in the 28-member bloc.

How to keep EU-member Ireland’s 500km border with Northern Ireland open after Brexit and ensure it does not jeopardise two decades of peace in the British province is proving the most intractable issue in Britain’s tortuous efforts to leave the EU.

Before meeting Varadkar, Trump said he expected the premier would ask him about Brexit and it would all work out “very well” for Ireland.

“The way it (the border) works now is good, you want to try and keep it that way and I know that’s a big point of contention with respect to Brexit. I’m sure it’s going to work out well,” Trump told reporters.

Some 3600 people were killed during Northern Ireland’s “Troubles”, a sectarian conflict between mainly Protestant unionists, who want Northern Ireland to remain part of the UK, and predominantly Catholic Irish nationalists.

The 1998 Good Friday peace deal, which the US helped broker, largely ended the violence.

While Trump on Tuesday promised Britain a “phenomenal” post-Brexit trade deal, US House of Representatives Speaker Nancy Pelosi used a visit to both sides of the Irish border last month to warn her fellow lawmakers would not agree any such deal if Brexit ends up undermining peace in Ireland.

After he and Trump met, Varadkar said the president understood Brexit cannot result in the return of a hard border on the island.

He added the timing of their meeting was important as Trump would have heard “a certain story” from pro-Brexit lawmakers during the first stop-off of his European trip in Britain.

“He wants to keep that (the border) open and believes that can be done. We didn’t go into any particular details as to how he thinks that can be done but he understands that has to be a shared objective,” Varadkar said.

Trump said in his remarks that Ireland and the US have a great relationship, “as good as it’s been”.

Varadkar posted a picture on Twitter of a guest book the president and first lady Melania Trump had signed that included the message “I love your country!” The word “love” was underlined.

Varadkar, who had opposed extending an invitation to Trump as a cabinet minister before changing his mind when he took over as prime minister in 2017, met Trump on the tarmac at Shannon Airport and said it was a great pleasure to welcome him to Ireland.