Northern Ireland could veto its withdrawal from the EU, lawyers opposed to Brexit have argued.
A barrister said the country had control over its own constitutional change following the 1998 Good Friday Agreement which largely ended republican and loyalist violence.
Ronan Lavery QC said leaving the EU would have a catastrophic effect on the peace process during a legal challenge by a cross-community group of politicians and human rights campaigners to the Prime Minister's plan to trigger Article 50 negotiations on an exit.
Mr Lavery told Belfast's High Court: "Sovereignty over constitutional affairs has been ceded. It is not the relationship, as it might once have been, between a dominant partner in a relationship and a submissive partner in a relationship.
"The people of Northern Ireland have control over constitutional change, it cannot be imposed upon the people of Northern Ireland.
"If that means that Northern Ireland could exercise a veto over withdrawal then I am (asserting) that is what Britain and Ireland signed up to when they signed the Good Friday Agreement."
Some 56% of Northern Irish voters backed Remain in the June 23 referendum but some unionist-dominated parts supported Leave. The country's largest party, the Democratic Unionists, campaigned for Leave.
Theresa May plans to begin negotiations with the EU by next March.
Northern Ireland shares the UK's only land border with an EU state, the Republic of Ireland, and the British and Irish Governments have said they are keen to ensure there is no return to the hard borders of the past.
If the UK leaves the customs union, the EU could demand a hard border in Ireland to prevent goods flowing in and out of the EU from Northern Ireland without paying required tariffs or facing checks on rules of origin.
Mr Lavery warned that after Brexit any move to create a United Ireland would be subject to the permission of the other EU member states that Northern Ireland should join the EU - rather than the will of people who live there.
"That is a practical and illegal impediment to the nationalist aspiration for a United Ireland."
He said the referendum result had implications for unionists.
"What this upheaval has also caused is the nationalists' call for a border poll and a very real threat to the Union as it exists."
He warned: "Withdrawal from the EU could have a catastrophic effect on the peace process and that delicate constitutional balance which we have reached."
David Scoffield QC, who represents politicians opposed to the triggering of Article 50, said Brexit would cut across the operation of North/South all Ireland and East/West ministerial links with Great Britain.
The lawyer said parliament should have the final say on whether negotiations are triggered, legislative consent from the Northern Ireland Assembly should be sought and if the court rejected that, then constraints must be imposed on the power of the Government to begin the negotiations and the Northern Ireland Secretary should assess the impact of Brexit on those who live in Northern Ireland.