It was, as the Duke of Wellington reflected after his victory at the Battle of Waterloo, a damn close run thing.
The Iron Duke's Dublin residence stands opposite Government Buildings, where Taoiseach Enda Kenny has won right of residence for a second term of a length yet to be determined.
His election as Taoiseach on Friday was a close shave, his makeshift majority only firming up at the very last minute after delays, late breakdowns, disagreements and fudges. It was, in truth, less a dramatic victory than a bit of a shambles which fell over the finishing line.
It will matter less come Monday, when Ministers enter their new departments and the newly-returned Taoiseach begins the first second term a Fine Gael leader has ever won. But this close run thing could hardly have been much closer.
At noon, the appointed hour for Dáil proceedings to begin, there was no sign in the chamber of the acting Taoiseach or of the Independent TDs who would make or break his bid for re-election.
A couple of hours of frantic to-ing and fro-ing ensued as speakers were allowed windbag on in the Dáil for as long as they liked while Michael Noonan sought desperately to convince the Independents to come on board - with or without Roscommon-Galway TD Michael Fitzmaurice, who was holding out for the cause of the turfcutters and - perhaps - a ministerial job. When the vote was eventually taken, Enda Kenny secured 59 votes - one more than the bare majority with a Fianna Fáil abstention.
In fact, putting together a government after suffering a massive election defeat, in an unprecedentedly fractured Dáil where he commanded just 50 TDs, will probably in time be seen as quite an achievement by Kenny. For now, as with much of what he has achieved, it will be underestimated. But, also like much else he has achieved, it wasn’t pretty.
Friday signalled the end of 10 weeks of efforts to form a government. Not outrageous by European standards, but not what Ireland is used to. Even if there is no evidence the electorate has been getting as impatient as the reporters who have been covering every twist and turn in the saga, the politicians on all sides felt last weekend that they were reaching the end of the road.
One reason the process of forming a government with the Independents took so long is that Kenny tried all the other the options first. He tried Fianna Fáil. He wooed the Labour Party. He made eyes at the Greens.
All the while, Fine Gael negotiators were keeping in contact with the Independent TDs, loosely configured in three groups - the Independent Alliance of six TDs, the looser rural alliance of five TDs and the "independent independents", including the two Healy-Rae brothers, Katherine Zappone and Maureen O'Sullivan.
Privately, Kenny was sceptical they could ever be brought over the line, and once over, if they would stay there. On the other hand, his options were limited. Simon Coveney, Eoghan Murphy and Simon Harris and the others kept plugging away with the Independents. And they kept telling the Taoiseach: we can get a deal.
Eventually, having had his offer of a grand coalition definitively rejected by Micheál Martin, Kenny struck a deal with Fianna Fáil to facilitate a minority government. To make it realistic, he needed 58 votes - a bare majority in the House once Fianna Fail abstained.
Much of politics boils down to a numbers game. Kenny had 50 Fine Gael votes. By the time the talks reached their final stage in the past fortnight, he had two Independent votes: Michael Lowry’s and Katherine Zappone’s. He needed six more. The game was clear now. With Fianna Fáil on board, the Independents were the final piece of the jigsaw.
By now another important dynamic had entered into the dealmaking process - Noonan let it be known that the tight budget parameters of the forthcoming budget process could be loosened somewhat. The fiscal space was expanding.
The brightening prospects for the public finances also gave Noonan the ammunition to be the dealmaker - just as he had been in the talks with Fianna Fáil. It would prove crucial. Whether the budgetary expansion passes muster with the beady eyes of Brussels is another thing entirely. But it certainly pleased some people at the talks.
Fine Gael ministers had been bullish earlier this week that a new government would be in place by Wednesday or Thursday. Publicly, the Independents were much more cautious. Still lots to be agreed, they warned. Nothing settled yet. Shane Ross suggested it might well run into another week.
By Thursday lunchtime, it was clear matters were slowing down, not accelerating towards agreement. There could be no vote that day. At 3.30pm, Kenny called together the group of Fine Gael negotiators - Ministers, TDs and officials - who had been thrashing out the programme with the Independents, and before that with Fianna Fáil. It was clear, he said, there were still difficulties. The talks might need a deadline to focus minds.
He wanted views from around the table. Paschal Donohoe was first. There were risks either way, Donohoe said. A deadline might frighten off the Independents, but not imposing a deadline would allow the talks to drift into the weekend, and could yield a whole new set of problems. Others around the table concurred. If they did not force the issue now, they might find themselves in the same position this time next week. The last to speak was Noonan. His message was simple: go for it.
Donohoe and Simon Coveney - who has, more than anyone else, been the midwife to the agreement with the Independents - went to break the news. As they arrived in the room, just before 4.30pm, the Government chief whip Paul Kehoe got to his feet in the Dáil to announce the following day's business. There would be a vote on nominations for taoiseach at noon, Kehoe said. A low murmur went around the Dáil.
In the room with the Independent TDs, there was uproar.
Some of them were furious, accusing the Fine Gael side of trying to bounce them into an agreement before they were ready. They were right, of course - that’s exactly what Kenny was trying to do. Because he believed if they were left to their own devices, they would never be ready.
The internal strains in the two groups of Independent TDs now became acute. Publicly, the TDs insisted they were “totally united”. Privately, they were talking about letting people go.
Fitzmaurice left Dublin at 2am on Friday to head home. It was an exhausting evening in Government Buildings, where Fine Gael negotiators had rejected his arguments for an easing of the restrictions on turf cutting, citing European law. Fitzmaurice had supplied his own legal opinions, but to no avail. Kenny was prepared to do almost anything to secure a Dáil majority that would elect him Taoiseach. But he wasn’t prepared to break the law.
After three hours sleep, Fitzmaurice was on the road again. He met local supporters, who endorsed his uncompromising line. He headed back to Dublin fully aware he was not going to be in a position to support a Fine Gael minority government, and told his Independent Alliance colleagues in a series of phone calls. They urged him to reconsider as they gathered for an 11am meeting with Kenny to sign off on their agreements.
But the acting Taoiseach was 20 minutes late for the meeting, and time was getting tight before the noon deadline. That vote, the TDs were told, was proceeding. If Kenny didn’t go to Áras an Uachtaráin to receive his seal of office having been elected by the Dáil, he would be going to seek a dissolution. After all the long weeks of negotiations, it was decision time.
But not just yet. The Dáil opened proceedings a few minutes after 12pm. Over in Government Buildings, meanwhile, Coveney and Noonan were trying to calm an agitated Independent Alliance.
Shane Ross and Finian McGrath had been ready to sign on the dotted line for weeks. But Fitzmaurice was stuck on turf and and Galway TD Seán Canney wanted firm assurances the Government would seriously consider investing in the long-promised - and, within official circles, much-derided - Western Rail Corridor.
Waterford TD John Halligan had taken an earbashing from his constituents in Waterford at an 8am meeting. If Fitzmaurice went overboard, he told Independent Alliance colleagues, he was jumping too. And if Canney walked, Kevin 'Boxer' Moran was out, too. Kenny's majority was hanging by a thread.
In the end, it was Noonan who brought them around.
I am the Minister for Finance, he told them. I will ensure these things are in the budget.
He promised Fitzmaurice a review of the turf issue. It wasn’t enough, but Noonan promised to go ahead with the review anyway. If it met with Fitzmaurice’s favour, he would be welcome to support the Government then.
Fitzmaurice didn’t bite, but it was enough to break the deadlock with the rest of the group. At a meeting with his Alliance colleagues, Fitzmaurice told them to proceed without him. He abstained in the vote for Taoiseach while his colleagues voted for Kenny.
Meanwhile, the rural alliance of Independents was falling apart. Mattie McGrath and Michael Collins opted out early, and would vote against Kenny. Noel Grealish abstained.
Denis Naughten was in, and would be named Minister for Communications. The last man to decide was Clare doctor Michael Harty. Minutes before the vote, he was still wavering. Fine Gael piled the pressure on. He would be the 58th vote, they told him.
In the end, he was the 59th. Close, but just enough.