<P> 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 previously pagan Picts to Celtic Christianity . Following England's Gregorian mission, the Pictish king Nechtan chose to abolish most Celtic practices in favour of the Roman rite, restricting Gaelic influence on his kingdom and avoiding war with Anglian Northumbria . Towards the end of the 8th century, the Viking invasions began, forcing the Picts and Gaels to cease their historic hostility to each other and to unite in the 9th century, forming the Kingdom of Scotland . </P> <P> The Kingdom of Scotland 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 issue in the early 11th century and the kingdom passed through his daughter's son to the House of Dunkeld or Canmore . The last Dunkeld king, Alexander III, died in 1286 . He left only his infant granddaughter Margaret, Maid of Norway as heir, who died herself four years later . England, under Edward I, would take advantage of this questioned succession to launch a series of conquests, resulting in the Wars of Scottish Independence, as Scotland passed back and forth between the House of Balliol and the House of Bruce . Scotland's ultimate victory confirmed Scotland as a fully independent and sovereign kingdom . </P> <P> When King David II died without issue, his nephew Robert II established the House of Stuart, which would rule Scotland uncontested for the next three centuries . James VI, Stuart king of Scotland, also inherited the throne of England in 1603, and the Stuart kings and queens ruled both independent kingdoms until the Act of Union in 1707 merged the two kingdoms into a new state, the Kingdom of Great Britain . Ruling until 1714, Queen Anne was the last Stuart monarch . Since 1714, the succession of the British monarchs of the houses of Hanover and Saxe - Coburg and Gotha (Windsor) has been due to their descent from James VI and I of the House of Stuart . </P> <P> 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 recent decades Scotland has enjoyed something of a cultural and economic renaissance, fuelled in part by a resurgent financial services sector and the proceeds of North Sea oil and gas . Since the 1950s, nationalism has become a strong political topic, with serious debates on Scottish independence, and a referendum in 2014 about leaving the British Union . </P>

When did scotland become part of united kingdom