Standing over the main gate of Dublin Castle is a statue depicting Justice. The figure holds a sword and a set of scales, to demonstrate that the implementation of the law will be swift but fair.

There's only one problem.

The statue faces the Castle, with her back to the city and its people. Many Irish nationalists down through the ages took this as an apt metaphor for how Britain governed Ireland.

Since the Castle was first built in the 12th Century, on the orders of King John, it was both the centre and the symbol of British rule and, therefore, a tempting target for those seeking to subvert that rule.

The 1534 rebellion of Silken Thomas foundered at the walls of the Castle; Robert Emmet failed to capture it in 1803; the 1916 rebels made a half-hearted – though almost successful – attempt to storm the gates.

The failure to capture the Castle defined the failure of those challenges to British rule.

But on 16 January 1922, Michael Collins and his colleagues drove into the Castle yard and were, in effect, handed the keys.

The "handover" of the Castle one hundred years ago was an important step on the long road to the creation of an independent Irish State, which is why it is being commemorated with an official State ceremony this weekend.

The chain of events which led Michael Collins to the Castle began with the Easter Rising of 1916. This was followed by the victory of Sinn Féin in the 1918 election, and the establishment of the First Dáil, the War of Independence, culminating in the Truce in July 1921, the signing of the Treaty in London on 6 December 1921, and its ratification by the Dáil on 7 January 1922.

Under the terms of the Treaty, the British government was to hand control of the administration of Ireland over to a "Provisional Government", which would hold power until the Irish Free State formally came into existence on 6 December 1922, a year to the day since the signing of the Treaty.

Arrangements for the transfer of power raised sensitivities on both sides. The British did not recognise the Dáil, and wanted to transfer power instead to the Parliament of Southern Ireland created by the 1920 Government of Ireland Act. The Irish did not want to acknowledge the existence of that Parliament, which they regarded as a British imposition.

The ingenious solution was to call a meeting of the members elected to sit in the Parliament of Southern Ireland, rather than the Parliament itself - a piece of constructive ambiguity which allowed both sides to save face. The meeting was also summoned by Arthur Griffith, as President of the Dáil, rather than by the Lord Lieutenant, the head of the British administration in Ireland.

When the meeting took place, on 14 January, it was attended by pro-Treaty TDs, and by the representatives elected by the Trinity College constituency, all of them Unionists who had stayed away from the Dáil. Anti-Treaty TDs did not attend, while allowed the meeting to unanimously approve the Treaty and elect a Provisional Government, chaired by Michael Collins.

There were now three governments in the 26 counties - the British administration which was preparing to hand over power but had not done so yet; the Dáil government headed by Arthur Griffith, which represented the bulk of Irish opinion but was not recognised by the British; and the Provisional Government headed by Collins, which was recognised by the British but had only limited legitimacy in Irish eyes.

While they remained legally distinct, the Dáil and Provisional Governments shared some members, and worked closely together. It was a messy solution to the need to paper over the difference between British and Irish interpretations of what was happening.

As one British official working in Dublin Castle, Mark Sturgis, observed, the world – and particularly the British – were now watching to see what sort of a fist the Irish would make of assuming the responsibility of government: "The phase... in which they must show whether they can set up a constructive machine, will be perhaps the most interesting of the lot..."

The transfer of authority took time - time for the new Irish ministers to take the reins in the various government departments; time to merge the old British administration with the underground Dáil departments which had emerged during the War of Independence; and time for British forces to pack up their belongings and withdraw from barracks around the country.

It’s probably better to think of the withdrawal and the transfer of power as a process rather than a single event. But what happened in Dublin Castle on 16 January 1922 is a very important step on the way. Almost as soon as the Provisional Government was officially recognised, the British military withdrawal picked up pace, as did the demobilisation of the Auxilliary Division and the Black and Tans – the paramilitary forces, designed to bolster the RIC, which had struck terror into many Irish communities in the preceding months.

But the transfer of power wasn’t the only story unfolding in the early months of 1922. The split over the terms of the Treaty within Sinn Féin and the IRA was becoming more entrenched, and more dangerous.

The Dáil Government initially agreed to allow an IRA Convention to be held in March; but as temperatures rose, it changed its mind. On 15 March, the Dáil Government decided that the Convention should not be permitted "on the grounds that while the Dáil continues to exist it is the sole body in supreme control of the Army and that any effort to set up another body in control would be tantamount to an attempt to establish a Military Dictatorship."

But the Convention went ahead, and agreed that the IRA should in future follow the orders of its own Executive, not the Dáil.

Griffith and Collins and their colleagues might control Dublin Castle; but they no longer controlled the IRA.

The slide to Civil War was now well under way.