His father, Sir James Dalrymple, 2nd Baronet of Hailes, near Haddington, was Auditor of the Exchequer in Scotland, and was a grandson of James Dalrymple, 1st Viscount of Stair; and his mother, Lady Christian Hamilton, was a daughter of Thomas Hamilton, 6th Earl of Haddington. He was the eldest of sixteen children. He was educated at Eton, and studied law at Utrecht. In 1748 upon his return to Scotland from Utrecht he was admitted an Advocate. He succeeded to his father's baronetcy upon his death in 1751, inheriting Newhailes House in Musselburgh. It is said that as a pleader he attained neither high distinction nor very extensive practice, but he rapidly established a well-deserved reputation for sound knowledge, unwearied application and strict probity, and in 1766 he was elevated to the bench in the Court of Session where he assumed the title of Lord Hailes. Ten years later he was appointed a Lord of Justiciary. His Edinburgh townhouse was at 23 New Street, north of the Canongate. He died at Newhailes House on 29 November 1792. He is buried in the family mausoleum at Morham churchyard near Haddington, East Lothian.
Family
He was twice married: firstly in 1763, to Anne Broun, daughter of Sir George Broun, Lord Coalston, a Lord of Session, by whom he had a daughter, Christian. He secondly married, on 20 March 1770, Helen Fergusson, daughter of Sir James Fergusson, Baronet, of Kilkerran, Ayrshire, by whom he had another daughter, Jean who married her cousin, James Fergusson, Esq., and left children. Upon the death of Lord Hailes, his baronetcy passed to his nephew, James, 4th Bt., the son of his brother John Dalrymple, Lord Provost of Edinburgh. Chambers provides an interesting anecdote in Traditions of Edinburgh about Lord Hailes's death. His daughter, Christian, nearly lost the inheritance of Newhailes House when his will could not be found. Facing eviction in favor of the male heir, she sent her domestic staff to lock up and shutter the Edinburgh house in New Street. Upon closing the shutters, "Lord Hailes's will dropped out upon the floor from behind a panel, and was found to secure her in the possession of his estates, which she enjoyed for upwards of forty years."
Lord Hailes as historian
Lord Hailes's most important contribution to literature was the Annals of Scotland, of which the first volume, From the accession of Malcolm III, surnamed Canmore, to the accession of Robert I, appeared in 1776, and the second, From the accession of Robert I, surnamed Bruce, to the accession of the house of Stewart, in 1779. It is, as his friend Dr Johnson justly described this work at the time of its appearance, a "Dictionary" of carefully sifted facts, which tells all that is wanted and all that is known, but without any laboured splendour of language or affected subtlety of conjecture. The other works of Lord Hailes include:
Historical Memoirs concerning the Provincial Councils of the Scottish Clergy
An Examination of some of the Arguments for the High Antiquity of Regiam Majestatem
In 1786 he published An Inquiry into the Secondary Causes which Mr Gibbon has assigned for the Rapid Growth of Christianity, one of the most respectable of the very many replies which were made to the famous 15th and 16th chapters of the Decline and Fall of the Roman Empire. A Memoir of Lord Hailes is prefixed to the 1808 reprint of his Inquiry into the Secondary Causes.