William Nairne, Lord Dunsinane

Sir William Nairne, Lord Dunsinane, 5th Baronet of Nairne (c. 1731–1811) was a Scottish advocate and judge, and the uncle of Katherine Ogilvie.

The title of Lord Dunsinane was taken from Dunsinane Hill, a ruined fort near Collace, Perthshire, the family seat of the Nairne family. Dunsinane Hill is referenced in Shakespeare's play, Macbeth. The alternative Gaelic spelling of the term Dunsinane is Dunsinnan, meaning "The hill of ants"; probably a reference to the large number of people it took to build the fortress.

Early life
William Nairne was born in Perthshire, Scotland in about 1731. He was the son of Sir William Nairne, 2nd Baronet and his wife, Emilia Graham of Fintry, Forfarshire. The Nairne baronetcy was conferred on Nairne's grandfather by Queen Anne on 31 March 1704.

Legal career
As the younger son of the 2nd Baronet, and under the presumption that ascending to the baronetcy was unlikely, Nairne pursued a career in law. He was admitted as an advocate on 11 March 1755, and in 1758 was appointed joint Commissary Clerk of Edinburgh with Alexander Nairne, a distant relative. He was made Sheriff of Perthshire in 1783. After thirty years as an advocate, Nairne was elevated to a Lord of Session, a position he held from 1786 to 1809. He also was appointed a Commissioner of Justiciary, a position he held from 1792 to 1808.

Nairne's ‘''Disputatio Juridica ad tit. 4 Lib. xx. Pand. Qui potiores in pignore vel hypotheca habeantur''’ was published in 1755. He also assisted in the collection of the ‘Decisions of the Court of Session from the end of the year 1756 to the end of the year 1760’, in 1765.

A portrait of Lord Dunsinane, painted by Scottish painter Sir Henry Raeburn (1756–1823), hangs in Parliament Hall, Edinburgh.

Connection to Katherine Ogilvie
Nairne was the uncle of Katherine "Kitty" Ogilvie, née Nairne. Katherine became a sensation throughout Scotland in 1765 when she and Lieut. Patrick Ogilvie, her brother-in-law and alleged lover, were convicted of incest and of the poisoning of Katherine's much older husband, Thomas Ogilvie of Eastmiln, Forfarshire. The case was salacious even by today's standards, with the main accusers being another Ogilvie brother, Alexander, and his recent bride, Anne Clark. Anne, prior to her marriage was employed as a house-servant in one of Edinburgh's notorious lewd houses, and Alexander may have harboured a desire to succeed to the estate of Thomas Ogilvie over his brother Patrick.

Both Katherine and Patrick were found guilty of their crimes. Patrick Ogilvie was hung in the Grassmarket of Edinburgh. Katherine, owing to pregnancy, was given a stay of execution sufficient to allow her to deliver her child. After delivering the child, and still being attended to daily by a midwife, Katherine slipped out of her prison cell clad in the midwife's clothes, including a head wrap the midwife had been wearing to help alleviate the pain of a toothache. Katherine purportedly left Edinburgh bound for Dover in a carriage driven by her uncle's clerk, James Bremmer. Once at Dover she obtained passage to France. A civil reward was offered for Katherine Nairne's capture, but to no avail.

Accounts vary as to the outcome for Katherine, including the fate of her child. One scenario has Katherine entering a convent, a second marrying a Dutch man and having a large family, and yet another has her dying in England at the beginning of the 19th century. Also unknown is whether Lord Dunsinane definitively aided in Katherine's escape. If he did, it would appear his involvement had no effect on his law career.

Personal life
Nairne succeeded to the baronetcy upon the death of his nephew William Nairne, the fourth baronet, in January 1790. Also around this time, Nairne purchased Dunsinane House at Collace, Perthshire for £16,000. Nairne was not a rich man; and in order to pay for its purchase, he had to adopt the most rigid economy. To save the expense of entertaining visitors, he is said to have kept only one bed at Dunsinane, and upon one occasion, after trying every option to get rid of his friend George Dempster, he exclaimed in despair, "George, if you stay, you will go to bed at ten and rise at three, and then I shall get the bed after you."

Nairne was also a friend of James Boswell, the lawyer, diarist, and author, who is best known for the biography of the English literary figure Samuel Johnson. Nairne accompanied Boswell and Dr. Johnson on the first leg of their famous Scottish Highlands tour in 1773.

In 1783 he was a joint founder of the Royal Society of Edinburgh. He served as the society's vice president from 1789 to 1796.

Sir Walter Scott described Nairne as "a man of unscrupulous integrity." When Nairne, who at the time was serving as Sheriff of Perthshire, determined that he had incorrectly found an innocent man guilty of a crime, he privately provided the litigant with the necessary funds to bring the case forward to the Court of Session, where his earlier judgement was reversed.

Nairne's dwelling in Edinburgh was Minto House on Chambers Street. After his death the property was subdivided as rental property, and eventually demolished in the 1870s. A new structure, also named Minto House was built on the site in 1878, and in 1927 it was acquired by University of Edinburgh for use at the headquarters for the Department of English and Modern Languages.

Sir William Nairne died at Dunsinane House on 23 March 1811 and was buried in the Nairne Mausoleum at the former parish church at Collace. A lifelong bachelor, the Nairne baronetcy became extinct upon his death. The heir to his estate was James Mellis, the son of Nairne's niece, who later assumed the surname of Nairne.