Image caption A series of Brexit papers from Stormont have been published by Sinn Féin

Northern Ireland's top civil servant warned the government its Brexit plan would present a "significant challenge", it has been revealed.

David Sterling's letter to the man who now works as the prime minister's Europe adviser was sent last August.

The government proposed a customs partnership with the EU as one way of avoiding a so-called hard Irish border.

In his letter, Mr Sterling pointed out there would be difficulties in implementing the suggested arrangement.

It has been published by Sinn Féin, which obtained it and more than 25 other Brexit documents from Stormont.

Mr Sterling sent his letter to Olly Robbins, then the civil servant leading Whitehall's Brexit department, a week after the government published its proposals for a solution to the border issue.

He wrote that the "visibility and impact" of whatever "robust enforcement mechanism" would be needed for the plan to work would be a "significant challenge".

Media playback is unsupported on your device Media caption What is the EU customs union?

He also expressed doubt about the government's plan for an exemption for small and medium-sized businesses trading across the border from complying with customs tariffs.

"The dividing line between businesses of different sizes in Northern Ireland supply chains will undoubtedly be blurred," he wrote.

That could make it "difficult" to define which firms were exempt, he added.

'Flexibility can be vital'

Another of the Stormont papers states that a scenario in which the UK does not secure a deal with the EU - a "disorderly exit" - would see a return to "the borders of the past".

It was suggested in the document from May last year that there would be a negative economic impact on Northern Ireland whether border checks were introduced on land or at sea.

The government argued that the use of technology could help to avoid the need for a hard Irish border.

But a briefing paper for Stormont civil servants, who were meeting officials from the government's Brexit department, states: "While technology can help, flexibility can be every bit as vital."

The Northern Ireland Executive also said it would have to have a seat at the table while the UK and the EU discussed legislation after Brexit.

It said that the region otherwise might not be able to implement EU law as envisioned in Brussels' "backstop" plan for avoiding a hard border in the absence of other solutions.

That plan would involve Northern Ireland staying in the customs union or single market to maintain a soft border.