The Democratic Unionist Party (DUP) has agreed a deal to restore power-sharing to Northern Ireland after a marathon session of late night talks.
The party has boycotted government at Stormont for almost two years in protest against post-Brexit trade arrangements.
But just after 1am on Tuesday, following more than five hours of talks at the Larchfield Estate in Co Down, party leader Sir Jeffrey Donaldson announced a deal had been agreed subject to new legislation being passed at Westminster.
Northern Ireland secretary Chris Heaton-Harris welcomed the DUP decision and made clear the government would deliver on its end of the deal.
Donaldson said he had secured the “decisive” backing of the 130-strong party executive during the historic meeting.
He said DUP party officers – a key decision-making body made up of 12 people – had also “mandated” him to move forward on the basis he was proposing.
However, he did face some opposition to the deal from some in the party who spoke against it at the executive meeting, while protesters outside the venue held placards accusing senior DUP members of a "sell-out".
Donaldson said the package of measures on the table represented "progress" across all of the party's "seven tests" for proposals designed to address its concerns on the trading arrangements.
He said the legislation agreed with Westminster would "remove checks on goods moving within the UK and remaining in NI, and end NI blindly following EU laws", regardless of who forms the next UK government.
Donaldson said: "There will be legislation protecting the Acts of Union, which guarantees unfettered access for Northern Ireland business to the rest of the UK."
Yahoo News UK examines what the deal means for the future of Northern Ireland.
Who are the key players?
Sir Jeffrey Donaldson
DUP leader Sir Jeffrey Donaldson has faced huge pressure to end his party's two-year Stormont blockade, which eventually led to Monday night's deal with Westminster.
However, the meeting showed there are still some in his party unhappy about the move, with some voicing opposition to the agreement, which was then leaked on X, formerly Twitter, and protesters outside the venue accusing the DUP of "selling out".
Donaldson left the Ulster Unionist Party (UUP) in 2003, after his opposition to the Good Friday Agreement saw him walk out of talks in protest, joining the DUP a year later, becoming leader in 2021.
Watch: Stormont power-sharing set to return after DUP executive backs deal
Donaldson supports Brexit, but was fiercely opposed to the Northern Ireland Protocol deal between the UK and the EU, arguing that it created an effective border between Northern Ireland and the rest of the UK.
He said on Tuesday: “When you are in leadership, sometimes that can be a lonely place. When you are in leadership you’ve got to step out and step up. You have got to make decisions based on what you believe is right and yes, you’ve got to display courage.
“I don’t worry about the stress, I am focused on what we need to achieve and I believe that my party, in acting decisively as it has done this evening, is taking strides towards building a better Northern Ireland and a better future for all of us.”
If and when power-sharing at Stormont does return, Sinn Féin vice-president Michelle O'Neill is in line to become the first nationalist first minister of Northern Ireland.
She served as deputy first minister between 2020 and 2022, the year in which Sinn Féin became the largest party in Northern Ireland following assembly elections, making her first minister in waiting.
She has broken with Republican tradition in recent years, attending the funeral of Queen Elizabeth II and the coronation of King Charles III.
Last week she criticised the DUP and urged them to help get Stormont back up and running.
She said: "People have rightly had enough of the DUP's inaction. My message to the DUP is to work with us, get round the executive table and make a difference to people’s lives.
"The DUP leader should do the right thing and restore the democratic institutions."
She said on Tuesday: "I welcome the public declaration by DUP leader Jeffrey Donaldson that power-sharing will now be restored.
"The parties will come together later today. We have much to do to confront the challenges facing our public services, workers and families which require urgent action."
Northern Ireland secretary Chris Heaton-Harris welcomed the DUP's decision to accept the deal with Westminster, calling it a “welcome and significant step” by the party.
He said: “I am pleased that the DUP have agreed to accept the package of measures that the UK government has put forward and as a result they are ready to return to the Northern Ireland Assembly and nominate representatives to the Northern Ireland Executive.
“Sir Jeffrey Donaldson has said this is subject to the binding commitments between the Democratic Unionist Party and the UK government – I can confirm that we will stick to this agreement."
Heaton-Harris was appointed secretary of state for Northern Ireland in September 2022 by Liz Truss during her short stint as prime minister but was retained in the role by her successor, Rishi Sunak.
He helped negotiate the Windsor Framework, a deal aimed at reducing checks on goods in Northern Ireland, envisaging a green lane for items that will remain in the country after arriving from Great Britain, and a red lane for those which may be sent to the EU.
What does it mean for Brexit?
The exact details of the deal between the DUP and Westminster are yet to emerge - Donaldson said he expects the full working agreement to be published as early as Wednesday.
However, the accord will address Brexit and the DUP's long-standing concerns that the Northern Ireland Protocol has created an Irish Sea border for goods within the UK. The country has remained within the EU's single market for goods while the rest of the UK has left.
The protocol was agreed between the EU and then prime minister Boris Johnson and came into force at the beginning of 2021, bringing in new checks at Northern Ireland's ports on goods travelling from Great Britain to Northern Ireland.
The DUP argued that the protocol cuts Northern Ireland off from the rest of the UK, while businesses were unhappy about the extra costs caused by checks.
Last year, a new deal, the Windsor Framework, was agreed between the UK and the EU and came into effect in October setting out plans for two different lanes for goods arriving into Northern Ireland from England, Scotland and Wales, depending on whether they stayed in the country or may be sent on to the EU.
However, the framework was not enough to persuade the DUP to return to power-sharing at Stormont.
On Tuesday, Donaldson said the new deal with Westminster would "remove those restrictions" that effectively created a customs border in the Irish Sea.
He told BBC Good Morning Ulster: "Are these proposals perfect? Have we achieved everything we wanted to achieve? No, we haven't."
He said the agreement ends "dynamic alignment with EU law", which he described as: "All new EU law applied automatically to Northern Ireland – that will now come to an end."
Any move to remove all checks and customs paperwork on trade between Great British and Northern Ireland trade would require EU support.
“For the movement of goods within the United Kingdom, the protocol of course imposed severe restrictions on the movement of those goods – these new arrangements remove those restrictions,” Donaldson told BBC Radio Ulster.
“Zero checks, zero customs paperwork on goods moving within the United Kingdom. That takes away the border within the UK between Northern Ireland and Great Britain and that is something that’s very important."
However, David Henig, UK director of the European Centre for International Political Economy think-tank, warned that Donaldson's claim the deal will remove checks for goods moving within the UK "isn't true" under the Windsor Framework. "So is this all really settled?" he asked.
What happens next?
Things could move pretty quickly, with Donaldson saying that the Northern Ireland Assembly at Stormont could be up and running again within days.
The first step, he said, will be the publication of the proposed deal with the DUP by UK government ministers, which is expected on Wednesday.
It is understood the government will introduce two statutory instruments at Westminster to give legislative effect to the commitments it has made on trade and sovereignty.
The legislation could then be passed in Parliament on Thursday, paving the way for a recall of the Assembly in Northern Ireland by Friday or even Saturday.
The return of Stormont will also see the UK Treasury release a £3.3bn package to support under-pressure public services in Northern Ireland, including funds to settle the demands of striking public sector workers.
Heaton-Harris said: “I now believe that all the conditions are in place for the Assembly to return, the parties entitled to form an executive are meeting tomorrow to discuss these matters and I hope to be able to finalise this deal with the political parties as soon as possible.”
In a press conference outside Parliament at lunchtime on Tuesday lunchtime, Heaton-Harris remained tight-lipped about the contents of the deal, which he said would be published on Wednesday, but said it included "some significant changes".
"When I publish the deal in Parliament, everyone will see what it is," he said.
When asked if the deal meant a renegotiation with the EU, Heaton-Harris replied: "I don't believe so."
In a press conference, Sinn Fein president Mary Lou McDonald said: "We are very pleased that we are at this juncture. Society has really suffered from the absence of government the past two years. We look forward to getting the job done.
"This is a great news story for all of Ireland. Brexit was always going to be difficult and massively disruptive. The job now is for all of us to support business. It's been a nightmare for business."
Sinn Fein vice-president and first minister in waiting Michelle O'Neill said: "I do think it is a day of optimism. I want to be in position because I want to make a different to people's lives.
"Let's get down to business, the public deserve no less.
"Power-sharing is the only show in town. I believe in life you get much more working together than working apart."
A spokesperson for the European Commission said: "We understand the UK government will soon publish the documents related to this deal so we will examine those texts when the time comes."
They said they expected the UK government to "fulfil its obligations" under the Windsor Framework.