German Chancellor Angela Merkel evoked memories of the Berlin Wall as she vowed to do everything possible to prevent a hard border.
At a closed-doors meeting with members of the border community, Ms Merkel recalled how, while growing up, she was separated from her grandmother by the wall.
Her first visit to Dublin in five years was described by those present as "emotional".
In a public message Taoiseach Leo Varadkar hopes will carry weight across Europe, Ms Merkel said she understood why Irish people were so desperate to hold on to peace.
"We simply have to be able to do this. We have to be successful and hope for a solution we can agree together," she said.
After what she called a "very moving" meeting with representatives of border communities, the chancellor said she would work "until the very last hour" to secure a Brexit deal.
"For 34 years I lived behind the Iron Curtain, so I know only too well what it means once borders vanish, once walls fall," she said.
"We need to do everything to bring about a peaceful co-operation."
However, her comments came against continuing uncertainty in the UK and growing fears in Brussels that a disorderly Brexit is inevitable.
A leading EU official said he could not rule out the prospect of customs points in Ireland.
Asked whether border posts would be needed between the Republic and Northern Ireland, Commission vice-president Jyrki Katainen said the aim was to ensure checks were done "away from the border if at all possible".
Senior officials were also warning that checks on animals and food produce, including milk, will have to take place.
The potential for a "milk lake" has even been raised, as farmers who sell diary products will no longer be able to send produce across the border. The EU will not accept creamery tanks containing "mixed EU and third-country milk".
At Farmleigh House, Ms Merkel was pressed on how the Good Friday Agreement could be upheld while the single market was also protected.
She refused to outline a solution but said: "You have the same saying as we say in Germany, 'Where there's a will there's a way'. We are working on this and have very good partners in the Commission, with Michel Barnier and Jean-Claude Juncker who are putting everything into finding a good ending."
Ms Merkel said her discussions in Dublin encouraged her "to explore ways to continue to ensure this peaceful co-existence you have worked so hard for".
Her comments came two days after French President Emmanuel Macron said his country would "never abandon" Ireland.
Government sources said the solidarity shown by the two superpowers meant that Ireland's standing with the EU Council is as "strong as ever".
A source said they hoped the chancellor now understood the emotional aspects linked to the border, as well as the technical side of the Good Friday Agreement.
Mr Varadkar said it was "not possible to have a clear plan" for what happens if the UK crashes out next Friday.
He said the EU was prepared to amend terms for future trade talks if Prime Minister Theresa May shifted her red lines.
"Both Ireland and Germany want to have a future relationship with the UK which is close and comprehensive and as deep as possible, and we would like to see the Withdrawal Agreement ratified so that we can begin the negotiations on a new economic and security partnership without further delay," he said.
However, he added: "There is very little time left."