A Brexit deal that threatens the union between Great Britain and Northern Ireland could lead to civil disorder by loyalists, the head of the Police Service of Northern Ireland has said.
Simon Byrne spoke to BBC Newsnight after Prime Minister Boris Johnson secured agreement with the EU.
The proposed plan would see new checks on goods coming in to Northern Ireland from the rest of the UK.
The consequences were partly about identity and practicalities, he said.
Some unionists have concerns that the proposed Brexit plan, which essentially draws a new customs border in the Irish Sea, results in NI being treated differently than the UK's other regions.
The Democratic Unionist Party (DUP) has called it "absurd" and "unconstitutional".
Progressive Unionist Party (PUP) leader Billy Hutchinson said it "separates us".
"For me, it's not really about Brexit, but it is about the constitutional position of Northern Ireland and about my Britishness and how it remains… I live in Belfast but I'm as British as anybody in Bradford or Birmingham and we need to be treated the same way," he told Newsnight.
But former Northern Ireland first minister Lord Trimble said the deal was "fully in accordance with the spirit of the Good Friday Agreement".
The UK government said there is "no doubt that Northern Ireland remains part of the UK's customs territory".
Mr Byrne's predecessor, George Hamilton, said that dissident republicans who are opposed to the peace process would try to "exploit" any hardening of the border - both "politically and ideologically" - and through engaging in organised crime, such as smuggling.
Mr Byrne added: "It's well rehearsed that any hard border between Northern Ireland the Republic will be seen as a return to state institutions by the nationalist community and it will raise the threat of attack towards infrastructure.
"But similarly from the loyalist community... identity is also important... and therefore whatever ends up as a Brexit deal, if there is one that could be perceived in a way that sort of threatens the security of the loyalist community... our concern is also the loyalist community has at times shown it can mobilise quickly, bring large numbers of people on to the streets and engage in public disorder in support of their cause."
'Rising of emotion'
Depending on the outcome of what happens with Brexit in the coming weeks or months, should it impact the union, Mr Byrne said "you can anticipate a lot of emotion in loyalist communities and the potential for civil disorder".
"Similarly if things go a different way, you can see a rising of emotion in the nationalist community a similar threat," he added.
In 2013, a loyalist protest over the union flag turned violent and dozens of police officers were injured in Belfast.
"There are a small number of people in both the loyalist and nationalist communities that are motivated by their own ideology and that have the potential to bring violence back on to the streets," said Mr Byrne.
"We need to make sure that we're in a position to thwart that sort of behaviour with the support of the communities and all parts of Northern Ireland."
There are currently about 6,700 police officers in the PSNI. Mr Byrne wants that to increase to about 7,500.
The UK government said it was committed to delivering "peace and progress".
"After many months of negotiations we have now presented a great new deal to Parliament that ensures we can move forward as one country, leaving the EU and its customs union together, and taking back control of our laws, borders, money and trade," a spokeswoman said.