Military history of Ireland
The Vikings pillaged monasteries on Ireland's west coast in 795, and then spread out to cover the rest of the coastline. The north and east of the island were most affected. During the first 40 years, the raids were conducted by small, mobile Viking groups. From 830 on, the groups consisted of large fleets of Viking ships. From 840, the Vikings began establishing permanent bases at the coasts. Dublin was the most significant settlement in the long term. The Irish became accustomed to the Viking presence and culture and in many cases became allies, with intermarriage common throughout Ireland. A major Irish battle involving Vikings was fought at the Battle of Clontarf in 1014, in which a large force of Vikings and their Irish allies were defeated by the gathered Irish forces of Brian Boru, then the High King of Ireland along with a small contingent of Viking defectors. After this date Viking activity was sporadic with various Kings and nobles attempting to extend their power base. In 1099, Magnus Barefoot, the King of Norway, and his Viking army had successfully campaigned alongside their Irish allies against opposing Irish warbands. On his return his force was ambushed and killed on the north coast of Ireland.
Viking Age
The end of the Viking Age is traditionally marked in England by the failed invasion attempted by the Norwegian king Harald III (Haraldr Harðráði), who was defeated by Saxon King Harold Godwinson in 1066 at the Battle of Stamford Bridge; in Ireland, the capture of Dublin by Strongbow and his Hiberno-Norman forces in 1171; and 1263 in Scotland by the defeat of King Hákon Hákonarson at the Battle of Largs by troops loyal to Alexander III. Godwinson was subsequently defeated within a month by another Viking descendant, William, Duke of Normandy. Scotland took its present form when it regained territory from the Norse between the 13th and the 15th centuries; the Western Isles and the Isle of Man remained under Scandinavian authority until 1266. Orkney and Shetland belonged to the king of Norway as late as 1469.