William Cunningham, 9th Earl of Glencairn (1610–1664), was a Scottish nobleman, Lord Chancellor of Scotland, and a cavalier. He was also the chief of Clan Cunningham.
The eldest son of William Cunningham, 8th Earl of Glencairn, on 21 July 1637 this William obtained a ratification from King Charles 1st, under the Royal Sign Manual, of the original Glencairn Letters Patent of 1488.
He was sworn a member of the Privy Council of Scotland and in 1641 was appointed a Commissioner of the Treasury.
The Earl supported the Royalist cause of his King, and in 1643 joined with the Duke of Hamilton and the Earls of Lanark and Roxburgh, in opposing the sending of a Scottish army into England to assist the English Parliamentary Army. For this loyalty he received a (now published) personal letter from the King.
He was appointed Lord Justice General by parliament in 1646. He knew of and is said to have "entered heartily into" the attempted rescue of Charles I in 1648, and was subsequently deprived by parliament of this post on 15 February 1649, under the Act of Classes. The parliament, now being dominant, at the instance of the Public Prosecutor, then passed a Decreet, on 2 March 1650, annulling the original Glencairn Letters Patent of 1488. (This was rescinded at the Restoration).
Glencairn then led an insurrection in the Highlands in 1653 (See: Royalist rising of 1651 to 1654) in favour of King Charles II, when General Monck had possession of Scotland. In January 1654 he was commissioned by Charles II to command the Royal forces in all of Scotland, numbering some 3,500 men, but he later handed his command to General Middleton. About this time Glencairn and Lieutenant-General Sir George Munro, 1st of Newmore engaged in a duel with both pistols & swords two miles to the south of Dornoch. Munro had poured scorn on the quality of their forces and Glencairn had defended them, challenging Munro, who lost but was only wounded. Middleton initially placed the Earl under arrest, but the Earl left the army a fortnight later.