It was like turning a lock, said one politician. Suddenly there was a click and the door opened
UNLIKE many Northern Ireland politicians, Seamus Mallon, the gaunt, soft-spoken SDLP MP for South Armagh, rarely says more than the moment requires. Three words uttered by Mallon in Stormont Castle's cheerless basement canteen in the early hours of Good Friday morning, summed up the irrevocable repositioning of the tectonic plates of Irish politics, as well as all the statements, soundbites and spin last week.

David Trimble, the Ulster Unionist leader, had wandered across from his table, littered with empty coffee cups, to exchange a few words with his nationalist opponents. Trimble made some suggestions about how the SDLP might present the deal it had just reached with his own party - itself something that would have been unthinkable a few weeks ago. As Trimble turned to go, Mallon raised the fingers of his right hand to his brow in a salute, smiled, and said quietly: "Yes, First Minister".

Nothing could more clearly illustrate the hopes for a new Irish politics invested in the new British-Irish agreement, which was completed 18 fraught hours later. The agreement provides for an elected, 108-seat, cross-community assembly, in which - to begin with anyway - the First Minister will be a Unionist, who will share his authority with a powerful nationalist deputy. This was, of course, only a component of an agreement the comprehensive nature of which is still hard to take in.

David Irvine, who leads the little PUP, one of two parties linked to loyalist paramilitaries, exclaimed: "Something amazing has happened; I never thought it would in my lifetime but it has." A few minutes later Monica Williams of the Women's Coalition emerged blinking out of the Castle Buildings, thinking it was still dark outside: "It's a bright, brand new day," she said.

Yet there were times when it looked as if it wouldn't happen. A few hours earlier, an exhausted Mo Mowlam, the pathologically cheerful Northern Ireland Secretary (now certain for promotion), had announced: "I think we should all go home."

Later, a mini-revolt among the Ulster Unionists at the eleventh hour threatened to derail the settlement - and pointed to the real problems that will confront those trying to sell the deal in the difficult weeks ahead. Yet Mallon's gentle salute to Trimble could scarcely have been a more potent symbol of the determination to put this covenant into practice.

IT HADN'T looked that promising on Tuesday, when Tony Blair flew to Belfast 24 hours earlier than planned. He was responding to urgent protests from David Trimble at the "green" or pro-nationalist tone he claimed to detect in the draft agreement produced by George Mitchell, the American chairman of the peace talks. That evening Blair went straight to Hillsborough Castle, the Secretary of State's viceregal residence, where he announced that this was no time for soundbites before coming up with his own: he felt the "hand of history on our shoulders", he said.

Blair spent the next day in an endless round of meetings, though the first one that mattered came at 7.15pm when he and Bertie Ahern, the Irish Prime Minister, came together with David Trimble and his deputy John Taylor to discuss the hypersensitive issue of the North-South bodies designed to foster cross-border co-operation. Blair calmly stressed the doctrine that there would be no change to the status of Northern Ireland without the consent of its people. When Ahern repeated the point even more emphatically, Trimble first said how much he appreciated Ahern returning so quickly after his mother's funeral. But it was Taylor, the man who had said he would not touch Mitchell's draft with a 40-foot barge pole, who made a remarkable intervention. For the first time he let it be known that Ahern was a man the Unionists could do business with.

The key relationship between Ahern and Blair had been cemented by the cordial relationship established by their senior private secretaries, Paddy Teahon and John Holmes. For example, Blair appealed to Ahern, on Trimble's behalf, to promise the winding up of the Maryfield Secretariat, an emblem of the Anglo-Irish Agreement which Unionists hate. "If they hadn't trusted each other, Ahern would have thought Blair was pulling a fast one," said a senior British official yesterday. It was this personal chemistry that cracked the vexed question of the relationship between the North-South bodies and the Northern Ireland Assembly earlier than expected.

But neither Ahern nor Blair took part in the most critical meetings on the nature of the assembly itself. The first of these was between teams of four from the SDLP and the Unionists. They made little progress as the midnight deadline passed on Thursday.

The talks resumed after a short break, and when they did so Jeffrey Donaldson was missing from the Unionist side. "These things are like turning a combination lock," the SDLP's Mark Durcan would say later. "Suddenly you hear a click and the door opens." The Ulster Unionist Party's bottom line was now exposed. They would, after all, agree to a cabinet-style executive and a "weighted" 60 per cent majority for assembly decisions. In practice they will require some nationalist support. The SDLP was delighted; so much so that Bridget Rodgers, the delegation's chairman, hugged Mallon just before she sternly warned her colleagues against showing excitement. Seconds later she went into another office, spotted the former SDLP MP Joe Hendron and gave him a hug, too. This was captured on television through the curtainless windows. Played again and again on TV news, it became a defining image of this stage of the talks. When John Hume led his small band upstairs to tell Blair

the news, it was an emotional moment. Hume shook hands with the Prime Minister. "There was a sort of feeling of 'can we really believe it?'," said one of the SDLP team.

Blair's energy was prodigious. He drafted wording at endless meetings with all the parties, shirt-sleeved and often with one foot on the table, sustained on an alcohol-free diet of bacon sandwiches, Twix bars and bananas. At times he became frustrated with the need that all the parties felt to spin to their own advantage to the dozens of television crews outside the talks.

The interplay between the television bulletins, filmed yards away from the Castle Buildings, and what was actually happening inside was an extraordinary feature of the negotiations. There was a weird moment when Blair and his press spokesman Alastair Campbell walked back from the little walled garden in Castle Buildings where they had gone for some air. As they walked through a back office, Gary Gibbon, the Channel Four News reporter, was saying on a television screen: "Even as I speak Tony Blair is currently locked in talks with David Trimble and Bertie Ahern." Blair glanced at the screen and muttered "No I'm not" - to be echoed by a Gilbertian chorus of clerks and secretaries shouting "no he's not".

Mo Mowlam, asked by BBC television if they could film office life in the Castle Buildings, could be heard shouting: "Can someone get me my bloody wig?"

But Bridget Rodgers's warning that there was no deal yet was prescient. It was this deal which threatened to unravel the following afternoon, when Trimble - under pressure from Donaldson - came under pressure to reopen talks. Before he had become an MP, Donaldson had been the Northern Ireland Office's blue-eyed boy - an instinctive power-sharer. Fiercely ambitious, Donaldson challenged an aspect of the deal which had not been discussed in detail at the crucial meeting.

He spotted that there was no direct link between the requirement on the IRA to begin decommissioning weapons, and the possibility of Sinn Fein's Gerry Adams sitting on the executive. Trimble was persuaded to revive the issue. That was the tensest meeting of all, with Blair, his chief of staff, Jonathan Powell, and Alastair Campbell, his spokesman. Outside, news bulletins were telling the world that a deal had already been done. Inside, Trimble, while stressing his desire for a deal, was trying to rewrite an agreement ready for the printers. Blair and Powell, who had established a friendly working relationship with the UUP (colleagues called him "Unionist"), robustly turned him down. Instead Blair gave Trimble a letter promising to support changes to the Assembly rules if Adams participated in the business of the executive before decommissioning was under way.

With skilled timing, Blair called Bill Clinton and asked him to make one more of the eight calls he made in all - some in the small hours, Washington time. The President told Trimble, as he had earlier told Adams, that the prizes would go to the men of vision. By 4.45pm Trimble was able to phone Blair and tell him that he would agree to back the deal.

It was surprising, but the decommissioning issue had caused more fuss even than the agreement provision for releasing paramilitary prisoners, though the issue did produce the one flash of gallows humour. One representative of the paramilitary-linked loyalist parties, infuriated by the UUP's last- minute prevarication, was heard loudly asking in the corridor: "If I murder them, will I still get out after two years?"

But it was the UUP MP Ken Maginnis who most eloquently summed up UUP thinking - and the spirit of the agreement. As he prepared to drive off from the talks on Friday evening, he declared: "Jeffrey [Donaldson] is not convinced that the governments are doing enough to plug the gaps. No one disputes that, but after 26 years of direct rule, in which we have been salami-sliced and people have done things behind our back, we are able to take responsibility for the future government of Northern Ireland. To get there we have had to enter partnerships and make agreements. But if we hadn't taken what was on offer, we would have been salami-sliced for the next 10 years."

But the momentum for change shouldn't be underestimated either. The relative flatness - despite all the media hype - of the reaction in both communities stems more from an extreme wariness, based on bitter experience, of anything which purports to change history. But the factors that ditched Sunningdale, for example, no longer have the same force. Ian Paisley cut a slightly obsolescent figure on Thursday night at his chaotic press conference. And to the official Unionists, MPs are not the only people who matter. Northern Ireland is only now beginning to absorb the scale of the change it is being offered. As Seamus Heaney put it yesterday, "Ulster will remain a site of contention, politically and culturally, but at least the contenders will have assented to play on the same pitch and by the same rules." That is an even greater, and even more hopeful, achievement than it sounds.

As Blair's party finally flew out of Belfast by RAF helicopter on Friday evening, Jonathan Powell took a call from Buckingham Palace on his mobile phone. The Queen would like to pass on her congratulations to the Prime Minister. Before Blair could take the call an airman stepped forward and ordered Powell to switch off the mobile phone. Immediately.

Queen and Prime Minister did not speak until he landed at Northolt. When they did so, it was on the understanding that history had been made that day.