When Charles I took the throne of England and Scotland, one of the things he tried to do was make the Scottish kirk more like the English church. He instituted a new Book of Common Prayer without input from the National Assembly. This angered the Scots, and riots broke out against the imposition of what was seen as Charles's English-influenced changes.
In 1638 a group of nobles met at Greyfriars Kirkyard in Edinburgh and signed an agreement that they called the National Covenant of Scotland. They affirmed their loyalty to the king, but asserted the legality of the kirk and its customs. It was essentially a statement of independence in religious matters and a protest against English influence in church matters.
The National Assembly
The Covenant was circulated around the country and those who signed it were called Covenanters. The Covenanters called a National Assembly which gathered in November 1638. The National Assembly abolished the system of bishops imposed by James VI, rejected the Book of Common Prayer, and refused the rest of Charles I's plans for church reform. They also raised an army; which might seem odd considering they made clear their allegiance to the king.
The Covenanters army was under the leadership of Alexander Leslie. Charles promised to meet with the Covenanters if they disbanded their army. They did, but Charles did not keep his word. The Covenanters raised a new army led by James Graham, the Earl of Montrose, and marched into England. The king was forced to treat with them. This time, however, the Covenanters did not trust Charles, and they reached an agreement directly with Parliament, by which terms all of the National Assembly's terms were accepted.
Unfortunately, after these resounding successes, things went sour. The Covenanters quarrelled amongst themselves. some wanted to force the king to abdicate. Others were alarmed because people were being forced to sign the Covenant.
However, the power struggle in the Covenanters army was nothing compared to the struggle in English society; Parliament and King Charles were about to embark on a civil war, and both sides courted the Scots. The Scots saw their chance and demanded a Scottish-style church in England in exchange for their help. Parliament agreed with these terms and signed the Solemn League and Covenant. The Covenanters army then joined the English Civil War on Parliament's side. The Scots played a leading role in the decisive Royalist victory at the Battle of Marston Moor.
However, though the Covenanters joined Parliament, their erstwhile leader, the Earl of Montrose, could not bring himself to turn against the king. He felt that the Covenanters had gone far beyond the terms of the original Covenant and he joined the Royalist side. With Charles's blessing, he returned to Scotland to raise a Royalist army.
This he did, drawing heavily on support from the Highland clans, and fighting a guerilla war with small, quick-moving forces. His tactics proved a huge success and within a year he had taken almost all of Scotland for the king. He was on his way south to England when he met a Covenanters army under Leslie at Selkirk. The Covenanters won a massive victory, and Montrose was forced to flee.
Charles surrendered to a Covenanting army in England. The Scots were now unsuccessful on several fronts; Charles would not agree to sign the Solemn League and Covenant, and Parliament refused to pay the Scots expenses as promised. The Covenanters finally returned to Scotland and gave Charles over to Parliament after Parliament affirmed that no harm would come to the king. That promise, of course, was not kept, and Charles was eventually executed.
The Earl of Argyll took over control of Scotland. He declared war on England and proclaimed Charles II as king. Even with the support of a Scots army under Argyll, Charles did not trust the Scots. After all, he reasoned, they had handed over his father to Parliament. Charles did not trust the Earl of Montrose, nor did he feel he could sign the Solemn League and Covenant. The Earl of Montrose was betrayed by his enemies and executed in Edinburgh.
Charles II eventually agreed to sign the Covenant, though it seems only as a pretext so he could gain Scottish support in his bid to reclaim the English throne.
Now roles were reversed and the Covenanters in Scotland fought on behalf of a Stuart king. Oliver Cromwell led his Parliamentary army into Scotland and defeated Charles and Covenanters and Charles was forced to flee the country once again.
Finally, in 1660 Charles was restored to the English throne. Now he showed his true colours in regard to Scotland; he declared invalid all laws passed by the parliament since 1633. He replaced the General Assembly of the Church of Scotland with bishops on the English model, and they were placed under the control of Parliament. Not unnaturally, Charles's measures were resented and caused more religious turmoil.