DUBLIN, Ireland ― What started four weeks ago as a sex scandal that threatened to plunge Northern Ireland into crisis has ended in a new political agreement that strengthens the province’s unique power-sharing arrangements.

British prime minister Gordon Brown and his Irish counterpart Brian Cowen flew to Hillsborough Castle outside Belfast before dawn yesterday to celebrate the interparty deal after 10 days of round-the-clock negotiations.

The agreement, worked out by the Protestant Democratic Unionist Party (DUP) and Sinn Fein, which aspires to a united Ireland, provides the last elements in the process of devolution painstakingly negotiated over two decades.

The power-sharing Northern Ireland government will take on police and justice powers on April 12 with the help of a British Government grant of £800 million ($1.25 billion). The communities will cooperate on the handling of contentious Orange Order parades through Catholic areas.

Unionists place much importance on the right of the Orange Order, which celebrates the defeat of Catholic rebels in 1690 by King William of Orange, to parade along traditional routes, even where they are offensive to Catholic residents. Contentious parades have caused major rioting in past years.

The power-sharing threatened to crash in early January after an affair between 59-year-old Iris Robinson, wife of Northern Ireland’s First Minister Peter Robinson, and a 19-year-old youth, Kirk McCambley, became public.

Robinson stepped down temporarily as First Minister while government lawyers investigated if financial irregularities existed in connection with his wife’s affair, but he has been cleared.

The prospect of imminent disaster focused Catholic and Protestant politicians who had made the community government dysfunctional over squabbles about Irish language rights, north-south cooperation and loyalist parades.

Robinson and Sinn Fein Deputy First Minister Martin McGuinness appeared together with the two prime ministers for a press concerence. “This might be the day when the political process comes of age,” McGuinness said.

Robinson said that the deal, achieved after the longest round of continuous negotiations in the tortuous history of the peace process, would secure the power-sharing assembly “for decades to come.” He added, “politics is working, we are not going back to the past.”

The normally humorless First Minister drew laughter when he speculated that if negotiating were an Olympic sport, “we would enter a team, we would win a gold medal, and we would then start negotiating to decide what flag and anthem we would have.”

While both prime ministers talked about the deal making history, the bitterness between the two top ministers was still on show at the press conference. Robinson declined to shake hands with McGuinness when invited to do so by a reporter.

“I’m not into political stunts,” he said.

The DUP leader has consistently refused to shake hands publicly with McGuinness, a former Irish Republican Army leader, though they privately shook hands last month when McGuinness sympathized with Robinson’s family difficulties.

The devolution of policing and justice powers by the British Government is of critical importance to Sinn Fein, which persuaded its voters to accept the partition of Ireland partly on the basis that nationalists would jointly control law and order.

Before the Northern Ireland “Troubles” began 40 years ago, a majority unionist government controlled a paramilitary police force known as the Royal Ulster Constabulary. The police force was demilitarized under direct British rule and renamed the Police Service of Northern Ireland (PSNI) to make it more widely acceptable.

According to the agreement, a six-member working group is to be established to provide local solutions that respect the rights of those who parade as well as nationalist residents.

“This is the last chapter of a long and troubled story and the beginning of a new chapter after decades of violence, years of talks, weeks of stalemate,” commented Brown, whose prospects in this year’s British general election will have been improved by the success of negotiations he and Cowen have sponsored.

Cowen said he believed the deal laid the foundations for a new future “built on mutual respect for people of different traditions, equality and tolerance and respect for each other’s political aspirations and cultural expressions and inheritance.”

The end of 120 hours of negotiations came just before midnight Feb. 4 when Robinson secured agreement from his assembly party. He still faces opposition from a hard-line unionist faction, the Traditional Unionist Voice, led by Jim Allister.

Allister alleged that the DUP had caved in and accepted a deal they had originally rejected. “The deal hasn’t changed, only the snowmen of the DUP, who melted once the heat came on,” he said.