The recorded history of Scotland begins with the arrival of the Roman Empire in the 1st century, when the province of Britannia reached the Antonine Wall. North of this was Caledonia, inhabited by the Picti, whose uprisings forced Rome's legions to Hadrian's Wall. As Rome withdrew from Britain, a Gaelic tribe from Ireland called the Scoti began colonising Western Scotland. Before Roman times, prehistoric Scotland entered the Neolithic Era about 4000 BC, the Bronze Age about 2000 BC, and the Iron Age around 700 BC.

The Gaelic kingdom of Dál Riata was founded on the west coast of Scotland in the 6th century. In the following century, Irish missionaries introduced the pagan Picts to Celtic Christianity. Following England's Gregorian mission, the Pictish king Nechtan abolished most Celtic practices in favour of the Roman Rite, restricting Gaelic influence on his kingdom and avoiding war with Anglian Northumbria. Viking invasions began towards the end of the 8th century, forcing the Picts and Gaels to cease their hostility to each other and to unite in the 9th century, forming the Kingdom of Scotland.

The kingdom was united under the House of Alpin, whose members fought among each other during frequent disputed successions. The last Alpin king, Malcolm II, died without a male issue in the early 11th century; the kingdom passed through his daughter's son to the House of Dunkeld or Canmore. The last Dunkeld king, Alexander III, died in 1286 and his infant granddaughter, Margaret, as heir; she died four years later. England, under Edward I, launched a series of conquests, resulting in the Wars of Scottish Independence, as Scotland frequently passed between the House of Balliol and the House of Bruce through the late Middle Ages. Scotland's ultimate victory confirmed Scotland as a fully independent and sovereign kingdom.

In 1707, the Kingdom of Scotland united with the Kingdom of England to create the Kingdom of Great Britain under the terms of the Treaty of Union. The Parliament of Scotland was subsumed into the Parliament of Great Britain in London with 45 Members of Parliament (MPs) representing Scottish affairs in the newly created parliament. During the Scottish Enlightenment and Industrial Revolution, Scotland became one of the commercial, intellectual and industrial powerhouses of Europe. Later, its industrial decline following the Second World War was particularly acute. In 1999, a Scottish Parliament was reconvened and a Scottish Government re–established under the Scotland Act 1998. In 2014, a referendum on Scotland regaining its independence from the United Kingdom was held, in which 55% of the electorate voted to remain a country of the United Kingdom.

Pre-history

Although there have been claims of Lower Paleolithic finds in Scotland, none stand up to close scrutiny. The earliest known human presence in Scotland are those of Upper Paleolithic hunter gathers, dating to the Bølling–Allerød Interstadial warm period at the end of the last ice age, around 14,670 to c. 12,900 years Before Present shortly following the retreat of the ice sheet that had previously covered Scotland. The earliest known site of human presence is the Howburn Farm encampment near Biggar, South Lanarkshire, which is dated to around 14,500 to 14,000 years ago, and is associated with the reindeer hunting Hamburgian culture. Several other waves of late Upper Paleolithic peoples are known to have inhabited Scotland, including the Federmesser and Ahrensburgian cultures. Other sites found around Scotland build up a picture of highly mobile boat-using people making tools from bone, stone and antlers.. The oldest house for which there is evidence in Britain is the oval structure of wooden posts found at South Queensferry near the Firth of Forth, dating from the Mesolithic period, about 8240 BC. The earliest stone structures are probably the three hearths found at Jura, dated to about 6000 BC..

Neolithic farming brought permanent settlements. Evidence of these includes the well-preserved stone house at Knap of Howar on Papa Westray, dating from around 3500 BC in . and the village of similar houses at Skara Brae on West Mainland, Orkney from about 500 years later.. The settlers introduced chambered cairn tombs from around 3500 BC, as at Maeshowe, and from about 3000 BC the many standing stones and circles such as those at Stenness on the mainland of Orkney, which date from about 3100 BC, of four stones, the tallest of which is in height.. These were part of a pattern that developed in many regions across Europe at about the same time..

The creation of cairns and Megalithic monuments continued into the Bronze Age, which began in Scotland about 2000 BC.. As elsewhere in Europe, hill forts were first introduced in this period, including the occupation of Eildon Hill near Melrose in the Scottish Borders, from around 1000 BC, which accommodated several hundred houses on a fortified hilltop.. From the Early and Middle Bronze Age there is evidence of cellular round houses of stone, as at Jarlshof and Sumburgh in Shetland.. There is also evidence of the occupation of crannogs, roundhouses partially or entirely built on artificial islands, usually in lakes, rivers and estuarine waters..

In the early Iron Age, from the seventh century BC, cellular houses began to be replaced on the northern isles by simple Atlantic roundhouses, substantial circular buildings with a dry stone construction. From about 400 BC, more complex Atlantic roundhouses began to be built, as at Howe, Orkney and Crosskirk, Caithness.. The most massive constructions that date from this era are the circular broch towers, probably dating from about 200 BC. This period also saw the first wheelhouses, a roundhouse with a characteristic outer wall, within which was a circle of stone piers (bearing a resemblance to the spokes of a wheel), but these would flourish most in the era of Roman occupation. There is evidence for about 1,000 Iron Age hill forts in Scotland, most located below the Clyde-Forth line, which have suggested to some archaeologists the emergence of a society of petty rulers and warrior elites recognisable from Roman accounts.

Roman invasion

Of the surviving pre-Roman accounts of Scotland, the first written reference to Scotland was the Greek Pytheas of Massalia, who may have circumnavigated the British Isles of Albion (Britain) and Ierne (Ireland) sometime around 325 BC. The most northerly point of Britain was called Orcas (Orkney).Diodorus Siculus' Bibliotheca Historica Book V. Chapter XXI. Section 4 Greek text at the Perseus Project. By the time of Pliny the Elder, who died in AD 79, Roman knowledge of the geography of Scotland had extended to the Hebudes (The Hebrides), Dumna (probably the Outer Hebrides), the Caledonian Forest and the people of the Caledonii, from whom the Romans named the region north of their control Caledonia. Ptolemy, possibly drawing on earlier sources of information as well as more contemporary accounts from the Agricolan invasion, identified 18 tribes in ScotlandList in Ptolemy's Geography -in Greek- of all tribes-cities of Albion, including non-Scots: in his Geography, but many of the names are obscure and the geography becomes less reliable in the north and west, suggesting early Roman knowledge of these areas was confined to observations from the sea..

The Roman invasion of Britain began in earnest in AD 43, leading to the establishment of the Roman province of Britannia in the south. By the year 71, the Roman governor Quintus Petillius Cerialis had launched an invasion of what is now Scotland.. In the year 78, Gnaeus Julius Agricola arrived in Britain to take up his appointment as the new governor and began a series of major incursions. He is said to have pushed his armies to the estuary of the "River Taus" (usually assumed to be the River Tay) and established forts there, including a legionary fortress at Inchtuthil. After his victory over the northern tribes at Mons Graupius in 84, a series of forts and towers were established along the Gask Ridge, which marked the boundary between the Lowland and Highland zones, probably forming the first Roman limes or frontier in Scotland. Agricola's successors were unable or unwilling to further subdue the far north.. By the year 87, the occupation was limited to the Southern UplandsHanson, William S. The Roman Presence: Brief Interludes, in Edwards, Kevin J. & Ralston, Ian B.M. (Eds) (2003). Scotland After the Ice Age: Environment, Archeology and History, 8000 BC—AD 1000. Edinburgh. Edinburgh University Press. and by the end of the first century the northern limit of Roman expansion was a line drawn between the Tyne and Solway Firth. The Romans eventually withdrew to a line in what is now northern England, building the fortification known as Hadrian's Wall from coast to coast.

Around 141, the Romans undertook a reoccupation of southern Scotland, moving up to construct a new limes between the Firth of Forth and the Firth of Clyde, which became the Antonine Wall. The largest Roman construction inside Scotland, it is a sward-covered wall made of turf around high, with nineteen forts. It extended for . Having taken twelve years to build, the wall was overrun and abandoned soon after 160."History" , antoninewall.org. Retrieved 25 July 2008.. The Romans retreated to the line of Hadrian's Wall.. Roman troops penetrated far into the north of modern Scotland several more times, with at least four major campaigns.. The most notable invasion was in 209 when the emperor Septimius Severus led a major force north. After the death of Severus in 210 they withdrew south to Hadrian's Wall, which would be Roman frontier until it collapsed in the 5th century..

The Great Conspiracy constituted a seemingly coordinated invasion against Roman rule in Britain in the later 4th century, which included the participation of the Gaelic Scoti and the Caledonians, who were then known as Picts by the Romans. This was defeated by the comes Theodosius, however, Roman military government was withdrawn from the island altogether by the early 5th century, resulting in the Anglo-Saxon settlement of Britain and the immigration of the Saxons to southeastern Scotland and the rest of eastern Great Britain.

By the close of the Roman occupation of southern and central Britain in the 5th century, the Picts had emerged as the dominant force in northern Scotland, with the various Brythonic tribes the Romans had first encountered there occupying the southern half of the country. Roman influence on Scottish culture and history was not enduring..

Post-Roman Scotland

In the centuries after the departure of the Romans from Britain, there were four groups within the borders of what is now Scotland. In the east were the Picts, with kingdoms between the river Forth and Shetland. In the late 6th century the dominant force was the Kingdom of Fortriu, whose lands were centred on Strathearn and Menteith and who raided along the eastern coast into modern England. In the west were the Gaelic (Goidelic)-speaking people of Dál Riata with their royal fortress at Dunadd in Argyll, with close links with the island of Ireland, from whom comes the name Scots.. In the south was the British (Brythonic) Kingdom of Strathclyde, descendants of the peoples of the Roman-influenced kingdoms of "Hen Ogledd" (Old north), often named Alt Clut, the Brythonic name for their capital at Dumbarton Rock. Finally, there were the English or "Angles", Germanic invaders who had overrun much of southern Britain and held the Kingdom of Bernicia, in the south-east. in . The first English king in the historical record is Ida, who is said to have obtained the throne and the kingdom about 547.. Ida's grandson, Æthelfrith, united his kingdom with Deira to the south to form Northumbria around the year 604. There were changes of dynasty, and the kingdom was divided, but it was re-united under Æthelfrith's son Oswald (r. 634–642)..