Northern Ireland's first and deputy first ministers have said they must be fully involved in negotiations regarding the UK's future relationships with the EU and other countries following the referendum on Britain leaving the European Union.

Arlene Foster and Martin McGuinness have written to British Prime Minister Theresa May and stressed that the border must not become a catalyst for illegal activity or create an incentive for those who wish to undermine the peace process.

The Stormont ministers also said they want to play their part in any engagement between the British and Irish governments in relation to the border.

The letter also refers to the "many thousands of people who commute each way across the border to work on a daily basis".

The content and tone of the letter have prompted claims from political rivals that Ms Foster has backtracked on her pre-referendum support for Brexit.

Ms Foster rejected the suggestion, saying: "Brexit means Brexit and our Prime Minister is very clear about that and I support her in that.

"That doesn't mean to say we close our eyes to some of the immediate challenges that are there. We have set out those challenges and now we move forward in a positive way."

While the UK as a whole voted to leave the EU in June's historic referendum, in Northern Ireland 56% backed Remain.

Of the five main parties in Northern Ireland, Sinn Féin, the SDLP, the Ulster Unionists and the Alliance Party all campaigned for Remain while the DUP, the region's largest party, backed Brexit.

Ms Foster and Mr McGuinness's joint letter to Ms May stressed that Brexit could not be allowed to compromise cross-border efforts to tackle organised crime and those opposed to the peace process.

The ministers also said it was critical to the economy that businesses retained their competitiveness and did not incur additional costs. It highlighted the need to retain access to sources of skilled and unskilled labour in the EU.

The vulnerability of an agri-food sector reliant on EU subsidies was also raised, as were concerns that a proportion of billions of euro of EU funds for projects in Northern Ireland may not be drawn down due to the exit.

Ms Foster said Brexit would open up great opportunities for Northern Ireland but it was right for her to highlight issues of concern.

She told BBC Radio Ulster: "It would be negligent of me not to point out where I believe the challenges are, because we are going into the all-important negotiation with our national government (with the EU)."

She added: "We are extracting ourselves from the European Union and it is right we identify where those challenges lie, but I fundamentally believe there are huge opportunities."

Ulster Unionist economy spokesman Steve Aiken said: "Given the content of the letter, I would question whether this is a DUP U-turn on their position on the referendum after the vote has taken place."

Jim Allister, leader of the Eurosceptic Traditional Unionist Voice party, said: "This letter illustrates an overriding desire by the DUP to pander to the Sinn Féin position of seeking to row back on the decision of our nation to leave the EU.

"The tone and content of this letter is so strongly pro-EU that it is hard to imagine it is co-authored by a party that campaigned for Brexit."

At a meeting with Ms Foster and Mr McGuinness in July, Ms May promised to work for a "practical solution" to the future of the border following the Brexit vote.

She said she would seek to reach a Brexit deal with Brussels which was "in the best interests of the whole United Kingdom".

Northern Ireland Secretary James Brokenshire has said he does not want to see the return of a hard border and wants to chart a "positive new future" for Northern Ireland.

Ms May also met Taoiseach Enda Kenny in London in July where they both agreed there will be no return of a hard border and the Prime Minister said Brexit will not undermine the peace process in the North.

She said: "It is in all our interests to work together to safeguard our national security and the outcome of the referendum will not undermine it.

"We are both fully committed to working together in support of the Northern Ireland Executive to build a better, stronger, safer future for the people of Northern Ireland."