19th century violent and constitutional campaigns for autonomy or independence culminated in an election in 1918 returning almost 70% of seats to Sinn Féin, who declared Irish independence from Britain and set up a parliament in Dublin, and declared the independence of Ireland from the United Kingdom. A war of independence followed that ended with the Anglo-Irish Treaty of 1922, which partitioned Ireland between the Irish Free State, which gained dominion status within the British Empire, and a devolved administration in Northern Ireland, which remained part of the UK. In 1937, Ireland declared itself fully independent of the United Kingdom.