Bringing back a hard border between Ireland and Northern Ireland after Brexit would "be a nightmare" that could undermine the peace process, John McDonnell has warned.

When asked what would happen to the border once Britain leaves the European Union, the shadow chancellor said Britain needed to have a close relationship with the customs union to ensure the peace process was not jeopardised.

"Bringing back a hard border would be a nightmare. It would not be practical anyway," Mr McDonnell told the BBC's Andrew Marr Show.

Brexit chief David Davis tells EU: "Don't put politics above prosperity"

"We have to have a relationship which is as close to the customs union as we can, because I would not want to see anything that undermines the peace process in particular and all the gains that we've had.

"A hard border would undermine that relationship that's been built up between north and south so delicately."

It comes after Leo Varadkar, the Irish Taoiseach, demanded a commitment there will be no return to a hard border between Northern Ireland and the Republic.

Attending a European summit in Sweden, he made clear Brexit negotiations could not move on to their second phase until the future status of the border was clear.

Brexit: the deciders Show all 8 1 /8 Brexit: the deciders Brexit: the deciders European Union's chief Brexit negotiator, Michel Barnier Getty Brexit: the deciders French President Emmanuel Macron Getty Brexit: the deciders German Chancellor Angela Merkel Reuters Brexit: the deciders Commission President Jean-Claude Juncker EPA Brexit: the deciders The European Parliament's chief Brexit negotiator Guy Verhofstadt Getty Brexit: the deciders Britain's Prime Minister Theresa May Getty Images Brexit: the deciders Britain's Chancellor of the Exchequer, Philip Hammond PA Brexit: the deciders After the first and second appointed Brexit secretaries resigned (David Davis and Dominic Raab respectively), Stephen Barclay is currently heading up the position PA

Theresa May, the Prime Minister, is anxious to secure the agreement of EU leaders to open discussions on Britain's future relations with the bloc - including a free trade deal - when they meet next month in Brussels.

However Mr Varadkar, who met Ms May in the margins of the gathering in Gothenburg, said that would require further "concessions" from the UK.

"Before we move to phase two talks on trade, we want taken off the table any suggestion that there will be a physical border, a hard border, new barriers to trade on the island of Ireland," he told reporters.

"If we have to wait until the New Year, if we have to wait for further concessions, so be it."

Leo Varadkar, the Irish Prime Minister, has demanded a commitment there will be no return to a hard border (AFP/Getty Images) (AFP/Getty)

Boris Johnson, the foreign secretary, who was in Dublin to meet his Irish counterpart, Simon Coveney, insisted there was no desire for a return to a hard border of the past.

However, Mr Coveney warned it was impossible to avoid some form of "border infrastructure" if - as Ms May has said - Britain is to leave the customs union and the single market.

"We simply don't see how we can avoid border infrastructure, whether it's on the border or somewhere else on the island if we have regulatory divergence in Northern Ireland versus the rest of the island," he told a joint news conference with Mr Johnson.

"When you have a different rule book applied to trade and business, well then, you are starting to go down the road of having to have checks and inspections."

But Mr Johnson argued the border issue could only be resolved in the context of the wider negotiations on Britain's future relationship with the EU.

"The issues of the Northern Irish border and how it works are intellectually intimately bound up with the questions of the customs union, the single market and Britain's relationship with those," he said.