Northern Ireland’s government was to reopen for the first time in three years on Saturday after rival parties rallied around a new power-sharing agreement that can help the volatile province handle the pressures of Brexit.

The region’s devolved assembly at Stormont collapsed in January 2017 over a scandal caused by the runaway costs of a renewable energy program.

Numerous rounds of increasingly acrimonious negotiations failed to reach a solution, and basic services were left unattended.

Pro-Irish republicans and pro-British unionists were pushed into an agreement on Friday by the threat of a new regional election if they missed a looming deadline on Monday.

The United Kingdom’s government in London also promised a large cash infusion into the tiny but strategically vital region if the republican Sinn Fein and the Democratic Unionist Party came to terms.

“Sinn Fein has taken the decision to re-enter the power-sharing institution and nominate ministers to the power-sharing executive,” party leader Mary Lou McDonald told reporters.

“We’re ready to do business,” she said.

DUP leader Arlene Foster earlier called the draft power-sharing agreement “fair and balanced.”

“We are ready to go back into the assembly,” Foster said.

The executive were to meet on Saturday afternoon to select new ministers and assign various portfolios.

The Belfast Telegraph newspaper reported that the DUP’s Foster would be re-installed as first minister and effective head of the government.

Sources told the paper that top Sinn Fein member Michelle O’Neill would serve as her deputy in a new executive that features several prominent women.

European Commission President Ursula von der Leyen hailed the agreement as “an extremely positive development for the people of Northern Ireland.”

Friday’s deal came with thousands of the region’s health care workers on strike.

The latest talks were launched in the wake of a Dec. 12 general election in the United Kingdom in which both the Democratic Unionist Party and Sinn Fein lost votes to smaller groups.

Analysts attributed the main parties’ losses to voter frustration at their inability to reach a compromise that could let a government in Belfast take care of the region’s daily needs.

A 1998 peace accord that ended three decades of violence over British rule of Northern Ireland, during which thousands died, requires the two main parties to share power.

The lack of an executive is especially fraught with danger for the region because of historic changes to its trade rules that are being imposed by Britain’s pending withdrawal from the European Union.

Northern Ireland’s border with the Republic of Ireland to the south provides the only U.K.-EU land frontier.

U.K. Prime Minister Boris Johnson’s EU withdrawal agreement puts pressure on local authorities to maintain frictionless trade while preserving an open border on the island of Ireland.

Negotiations to revive Stormont have been stuck on disagreements over the use of the Irish language and a mechanism giving minority governments veto rights.

The draft requires the executive “to provide official recognition of the status of the Irish language in Northern Ireland” and “respect the freedom of all persons … to choose, affirm, maintain and develop their national and cultural identity.”

It also eliminates the veto mechanism and compels the parties to build consensus on issues of dispute.

The U.K. government additionally promises to deliver a new financial package for the region that allows outstanding public-sector salaries to be paid.

Downing Street called the draft deal “a balanced package” and that the precise amount of new funding would be spelled out when agreement was reached.

“History is being made today,” Irish Foreign Minister Simon Coveney after both sides confirmed their support for the devolved government.

It can help “show that politics in Northern Ireland can be a force for good and brings people together,” he said.