Earl of Stair is a title in the Peerage of Scotland. It was created in 1703 for the lawyer and statesman John Dalrymple, 2nd Viscount of Stair.
Dalrymple's father, James Dalrymple, had been a prominent lawyer; having served as Lord President of the Court of Session, he was created a baronet, of Stair in the County of Ayr, in the Baronetage of Nova Scotia in 1664, and in 1690 he was raised to the Peerage of Scotland as Lord Glenluce and Stranraer and Viscount of Stair.
The son, John Dalrymple, actively supported William III's claim to the throne and served as Secretary of State for Scotland. However, he was forced to resign after he authorised the massacre of Glencoe of 1692. He was made Lord Newliston, Glenluce and Stranraer and Viscount of Dalrymple, at the same time as he was given the earldom, also in the Peerage of Scotland. All three titles were created with remainder, in default of male issue of his own, to the heirs male of his father.
The first Earl of Stair was succeeded by his eldest son, the second Earl. He was a prominent soldier and served as Commander-in-Chief of the Forces. In 1707 Lord Stair surrendered all his honours to the Crown, and obtained a new charter empowering him to name as his successor any male descendant of the first Viscount of Stair. In 1747, shortly before his death, he nominated his nephew John Dalrymple (d. 1789), second son of his third brother George Dalrymple (d. 1745). This was mostly because his second brother Colonel the Hon. William Dalrymple (d. 1744) (heir presumptive to the peerages from 1707 to 1744) had married Penelope Crichton, 4th Countess of Dumfries, a peeress in her own right. This nomination was contested and the House of Lords decided in favour of James Dalrymple (d. 1760), the second son of the aforementioned Colonel the Hon. William Dalrymple by his wife the Countess of Dumfries. The House of Lords decided in 1748 in this case that the power of nomination could not be validly exercised after the Union. On his uncle's death in 1747 James succeeded as third Earl of Stair.