Following the establishment of the Irish Free State, three deep water Treaty Ports at Berehaven, Queenstown (modern Cobh) and Lough Swilly were retained by the United Kingdom in accordance with the Anglo-Irish Treaty of 6 December 1921. Formerly, when the country was part of the United Kingdom of Great Britain and Ireland, the Royal Navy had designated its Ireland Station as a long-standing separate command.
The main reason for the retention of the ports was the U-boat Campaign around Irish coasts during World War I and the concern of the British government that it might recur. As a part of the overall Anglo-Irish settlement it was envisaged that all other Royal Navy, British Army and RAF personnel and equipment were to evacuate the Free State.
As part of the settlement of the Anglo-Irish Trade War in the 1930s, the ports were transferred to Ireland (the Free State's successor) in 1938 following agreements reached between the British and Irish Governments.
In 1921 Éamon de Valera originally offered - in an early version of the Anglo-Irish Treaty - to allow the British to continue to use the ports for a further period of five years. The British would also be able to use whatever harbours they required in wartime.
However Article 8 was defeated by republicans within de Valera's own party and removed from the final terms of the treaty. Instead the issue of the ports was addressed in Article 7:
The Annex referred to in that Article read as follows:
The Annex included reference to Belfast Lough because Northern Ireland was included within the original territory of the Irish Free State although under the Treaty it had the right to opt out of the Free State and back into the U.K.. It did so on 8 December 1922. With the departure of Northern Ireland from the Free State, this left three United Kingdom bases in the territory of the Free State (subsequently renamed Ireland in 1937). The continued occupation by the United Kingdom of these bases was a thorn in the side of Irish leaders at the time.