DUP leader Peter Robinson has endured the worst month of his life, but has emerged from the political debris today clutching a deal with Sinn Fein.
Only weeks have passed since his party backed him after the sex and money scandal surrounding his wife Iris, and now he has secured their support again for the agreement to save Stormont.
Until recently he appeared reluctant to broker a deal on devolving policing and justice powers with republicans, and he now faces claims of caving-in to a threat that Sinn Fein could collapse the Assembly and force his party into a damaging snap election.
His enemies will say that last month's scandal and this month's deal are, to borrow a phrase from the peace process, inextricably linked.
But Mr Robinson has already surprised opponents by the determination with which he has carved-out breathing-space at a time when many thought his career was doomed.
A matter of weeks ago it appeared his party was set for the political humiliation of being pushed into a swift deal with Sinn Fein, but the East Belfast MP has tried to combat that by tying republicans into lengthy negotiations and by trying to increase his political options through secret talks with the Ulster Unionists and the Conservative Party.
Now he believes he has a deal with republicans he can sell.
But when the early whispers of the Iris Robinson scandal began to ripple out in December, however, the DUP's first line of defence was denial.
When the leadership was approached by the Press Association in connection with only some of the allegations - four weeks before the BBC Spotlight programme blew the issue wide-open and revealed the full scale of the saga with the testimony of its whistleblower - the party's first reaction was to deny the claims.
Exactly when the DUP began planning its response to the impending crisis is unclear, but in the wake of those initial queries and with the TV documentary on the way, Mr Robinson and his advisers must have spent Christmas deciding on how to cope with the personal tragedy and political disaster that loomed ahead.
He has insisted, however, that the timing of his comments on the issue were dictated by concern for his wife's mental state.
On December 28, Mrs Robinson issued a statement revealing she was retiring from politics due to ill health. The 60-year-old Strangford MP, a mother-of-three, was a controversial figure best known for her infamous denunciation of homosexuality. The statement made no mention of the controversies to come.
On January 6, journalists were brought to the Robinsons' east Belfast home. They were handed a statement in Mrs Robinson's name revealing that 18 months before she had an affair, and that 10 months previously her regret at the incident had sparked a suicide attempt. There was little information on her lover, except to say: "I encouraged friends to assist him by providing financial support for a business venture."
In a televised address, Mr Robinson, choked with emotion, spoke of his utter devastation. After decades cultivating the image of a political hard man, he seemed broken. But the scripted speech and the presence of a card to "Dad" over his shoulder gave the impression, rightly or wrongly, of choreography. It was speculated that any strategy was aimed solely at insulating a devastated family, but subsequent events were to add to the appearance that an effort at damage limitation was also under way.
Mr Robinson returned to work the next day, but within hours the Spotlight allegations were televised: details of Mrs Robinson's 19-year-old lover, the efforts to set the teen up in business, the £50,000 she so easily secured from two wealthy property developers, plus the details of her suicide attempt as told by her former political adviser, turned whistleblower, Selwyn Black.
By January 11, Mr Robinson had temporarily stepped down as First Minister to fight off criticisms and care for his family. The Stormont corridors buzzed with speculation that the DUP would be forced into an immediate deal with Sinn Fein to avoid a devastating election.
The DUP, a party founded on its opposition to "big house" unionism and based on the rock of religious zeal, seemed set to be overwhelmed by a scandal centring on sex and money. It was even speculated that the next set of Sunday newspapers would deliver further damaging revelations.
But it was then that events started to turn. The talks with Sinn Fein began to drag on, and republicans were facing problems of their own.
Gerry Adams was challenged over his handling of claims his brother Liam abused his daughter, though the Sinn Fein President said he would give evidence on behalf of his niece in any future court case. Then came confirmation from Gerry Adams that his own father had been an abuser. There were further tensions as the party had to fight allegations of Liam Adams's past role in Sinn Fein.
Scandal and personal tragedy gave way, again, to politics with the shock news that during a break in talks with Sinn Fein, the DUP leader had met the Ulster Unionists and the Conservatives for secret talks in England. Details emerged of another secret meeting between the DUP, Ulster Unionists and Orange Order. Had republicans been wrong-footed by Mr Robinson? Could a new unionist election pact and the possibility of support from a future Tory government have strengthened the DUP's hand?
A collapse of the Assembly loomed. Crisis meetings between Mr Robinson and Martin McGuinness were followed by government-sponsored talks in Hillsborough. Within two weeks we have a deal, but not without tensions inside DUP ranks, where sceptics who rejected the outline of a deal five days ago have now come onboard.
In a further shift, the Ulster Unionists, perhaps under pressure from the Tories, have stepped back from their flirtation with the DUP. Mr Robinson's party has escaped an Assembly election, but will soon face a challenging general election and the threat of the hard-line Traditional Unionist Voice.
By failing to do an earlier deal with Sinn Fein, the DUP leader left his party a hostage to fortune. But over recent weeks he has fought ferociously to defend his position and his party's standing.
One of the most chaotic periods in Northern Ireland politics has ended, but its repercussions will be felt through 2010, and beyond.