Celtic tribes arrived on the island between 600-150 B.C. Invasions by Norsemen that began in the late 8th century were finally ended when King Brian BORU defeated the Danes in 1014. English invasions began in the 12th century and set off more than seven centuries of Anglo-Irish struggle marked by fierce rebellions and harsh repressions. A failed 1916 Easter Monday Rebellion touched off several years of guerrilla warfare that in 1921 resulted in independence from the UK for 26 southern counties; six northern (Ulster) counties remained part of the UK. In 1949, Ireland withdrew from the British Commonwealth; it joined the European Community in 1973. Irish governments have sought the peaceful unification of Ireland and have cooperated with Britain against terrorist groups. A peace settlement for Northern Ireland is gradually being implemented despite some difficulties. In 2006, the Irish and British governments developed and began to implement the St. Andrews Agreement, building on the Good Friday Agreement approved in 1998.