The Kingdom of Scotland (Scottish Gaelic: Rìoghachd na h-Alba; Scots: Kinrick o Scotland) was a sovereign state in northwest Europe traditionally said to have been founded in 843. Its territories expanded and shrank, but it came to occupy the northern third of the island of Great Britain, sharing a land border to the south with the Kingdom of England. It suffered many invasions by the English, but under Robert I it fought a successful War of Independence and remained an independent state throughout the late Middle Ages. Following the annexation of the Northern Isles from the Kingdom of Norway in 1472 and the final capture of the Royal Burgh of Berwick by the Kingdom of England in 1482, the territory of the Kingdom of Scotland corresponded to that of modern-day Scotland, bounded by the North Sea to the east, the Atlantic Ocean to the north and west, and the North Channel and Irish Sea to the southwest. In 1603, James VI of Scotland became King of England, joining Scotland with England in a personal union. In 1707, the two kingdoms were united to form the Kingdom of Great Britain under the terms of the Acts of Union.