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 of Orange's claim to the throne and served as Secretary of State.
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.
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.
He also died without issue and was succeeded by his distant relative Sir John Hamilton Dalrymple, 5th Baronet, of Killock, who became the eighth Earl of Stair (see below for earlier history of the baronetcy).
In 1841 he was created Baron Oxenfoord, of Cousland in the County of Edinburgh, in the Peerage of the United Kingdom, with remainder to his brother.
In May 2008 the fourteenth Earl was elected to sit as a Hereditary Cross-Bench Peer in the House of Lords following the death of Baroness Darcy de Knayth.
His second son Hew Dalrymple was the great-grandfather of Robert Dalrymple-Horn-Elphinstone, who was created a baronet, of Horn, and Logie Elphinstone in the County of Aberdeen, in 1828.
The title of the earldom comes from the hamlet of Stair, the ancestral home of the Dalrymple family who settled there in the 12th century.