William Douglas (1634-1694), younger son of the 1st Marquess of Douglas, was created Earl of Selkirk and Lord Daer and Shortcleuch in the peerage of Scotland on 4 August 1646. He married Anne Hamilton, 3rd Duchess of Hamilton, on 29 April 1656. In 1660 he legally changed his surname to Douglas-Hamilton, and was created Duke of Hamilton for life, as was then not uncommon practice in Scotland when a peeress in her own right married someone of lesser degree.
On 6 October 1688, the new Duke of Hamilton surrendered his previous peerages to the crown and they were reconferred on his younger son Charles Douglas (1663-1739), with remainder to each of Charles's younger brothers before his elder brother. (Charles had been christened as Charles Hamilton, but changed his name to Charles Douglas upon receiving his titles.) The novodamus dictated that, should the earldom ever devolve to the holder of the title of Duke of Hamilton, his younger brother and his heirs should succeed to the title before him. Further that were any Duke to hold the title at his death the Dukedom and the Selkirk titles should again separate to the eldest and second eldest sons. This remainder is so unusual that a dance was created around it - Hamilton House.
Charles Douglas died childless and the 3rd Earl of Selkirk was his younger brother John Hamilton (c.1664-1744) who on 14 April 1697 had been created Earl of Ruglen, Viscount of Riccartoun and Lord Hillhouse. He outlived his son and heir; the earldom of Ruglen and subsidiary titles passed to his daughter Anne Hamilton, 2nd Countess of Ruglen, and through her marriage to the families of the Earl of March and the Duke of Queensberry.
The earldom of Selkirk, being limited to male heirs, passed to the grandson of Basil Hamilton (1671-1701), the youngest brother of Charles and John. Upon succeeding to the title, Dunbar Hamilton (1722-1799) changed his surname to become Dunbar Douglas, 4th Earl of Selkirk. His son Thomas Douglas (1771-1820) and grandson Dunbar James Douglas (1809-1885) succeeded him.
Upon the sixth Earl's death, the earldom of Selkirk reverted to the senior line, devolving by virtue of the special remainder on the younger brother of the 12th Duke of Hamilton: Charles George Douglas-Hamilton (1847-1886), seventh earl of Selkirk. The 7th earl died childless and the title passed back to the 12th Duke. When he died without male issue, his fourth cousin Alfred Douglas Douglas-Hamilton (1862-1940) inherited the (9th) earldom of Selkirk along with the (13th) dukedom. Upon his death the dukedom went to his eldest son whilst the (10th) earldom of Selkirk went to his younger son George Nigel Douglas-Hamilton (1906-1994).
Upon the death of the 10th Earl, James Alexander Douglas-Hamilton, younger brother of the 15th Duke of Hamilton, became the 11th Earl. He disclaimed his peerages in order to remain in the House of Commons, was later elevated to the House of Lords with a life peerage as Baron Selkirk of Douglas, and is now a Member of the Scottish Parliament. His heir is John Andrew Douglas-Hamilton, Lord Daer Master of Selkirk.
The heir apparent is John Andrew Douglas-Hamilton, Master of Selkirk, Lord Daer (b. 8 Feb 1978)