Northern Ireland leaving the EU should not compromise cross-border efforts to tackle organised crime and those opposed to the peace process, Stormont leaders have told the Prime Minister.
The status of the border with the Republic post-Brexit should not enable illegal activity, Arlene Foster and Martin McGuinness warned Theresa May.
Northern Ireland is the only part of the UK with a land border with a member state.
Dissident republican groups who target police officers and other members of the security forces in Northern Ireland use the Republic for fundraising, training, engineering and storing weapons and occasionally as a preparatory base for attacks north of the border, according to a recent terror assessment.
The First Minister and Deputy First Minister said: "It is equally important that the border does not create an incentive for those who would wish to undermine the peace process and/or the political settlement."
The Prime Minister visited Belfast last month and said nobody wanted to see a return to the borders of the past.
Efforts to tackle lucrative cross-border smuggling are part of recent political accords agreed at Stormont.
Mrs Foster and Mr McGuinness wrote: "There have been difficult issues relating to the border throughout our history and the peace process.
"We therefore appreciate your stated determination that the border will not become an impediment to the movement of people, goods and services.
"It must not become a catalyst for illegal activity or compromise in any way the arrangements relating to criminal justice and tackling organised crime."
The ministers also said it was critical to the economy that businesses retained their competitiveness and did not incur additional costs through Brexit.
"Policies need to be sufficiently flexible to allow access to unskilled as well as highly skilled labour."
They noted thousands of people commuted across the border to work on a daily basis.
The all-Ireland energy market should also be protected, the ministers said.
A proportion of EU funds for projects in Northern Ireland may not be drawn down due to the exit and the ministers said that was of real concern.
The vulnerability of an agri-food sector reliant on EU subsidy was also raised.
The leaders said they wished to play a role in the engagement between the British and Irish governments on matters concerning the border.