Between 1644 and 1651 Scotland was involved in the Wars of the Three Kingdoms, a series of civil wars that were fought in Scotland, England (English Civil War) and in Ireland (Irish Confederate Wars). These wars followed other related conflicts: the Bishops Wars (between Scotland and England) and the Irish Rebellion of 1641.
In Scotland itself, from 1644–45 a Scottish civil war was fought between Scottish Royalists—supporters of Charles I under James Graham, 1st Marquis of Montrose—and the Covenanters, who had controlled Scotland since 1639 and allied with the English Parliament. The Scottish Royalists, aided by Irish troops, had a rapid series of victories in 1644–45, but were eventually defeated by the Covenanters.
However, the Covenanters then found themselves at odds with the English Parliament and backed the claims of Charles II to the thrones of England and Scotland. This led to the Third English Civil War, when Scotland was invaded and occupied by the Parliamentarian New Model Army under Oliver Cromwell.