Cairnes, David (1645–1722), defender of Derry, was born 15 November 1645. His father was either David Cairnes of Knockmany or John Cairnes of Parsonstown, both of Co. Tyrone; nothing is known of his mother. He had either one elder brother and two sisters, or at least three elder brothers. Alexander Cairnes (qv) was a son of John Cairnes of Parsonstown. A David Cairnes from Parsonstown entered the Middle Temple in London in February 1668 and was called to the Irish bar 29 June 1673. David Cairnes of Derry is known to have been practising law in Derry by 1680 (in which year he was chosen a burgess), and had acquired considerable property in the city as a result of his marriage (c.1676) to Margaret, daughter of Hugh Edwards of Hastings, Co. Tyrone, who had been the city's mayor.
As tensions rose in the city in late 1688 after the overthrow in England of King James II (qv), and on the approach of a Jacobite regiment commanded by Alexander MacDonnell (qv), earl of Antrim, Cairnes strongly recommended the formation of a garrison. Before he left for Knockmany, Cairnes possibly also urged on the young men of the city, one of whom was his nephew William Cairnes; on 7 December the ‘apprentice boys’ shut the gates to keep out Antrim's soldiers. Cairnes returned that afternoon and addressed the crowd gathered in the Diamond. He was the first member of the gentry to arrive in the city, and his support for the actions of the apprentice boys counteracted the counsels of the bishop, Ezekiel Hopkins (qv), and of the more timid merchants. Along with James Gordon (qv), a presbyterian minister, and Alderman Tompkins, Cairnes planned Derry's defence and caused an inventory to be made of all the ammunition and other supplies available; he was then sent by the city to seek assistance from William of Orange (qv) (William III from 13 February 1689) in England. He sailed the same night, in his own vessel and at his own expense, and though delayed by foul weather reached London on 7 January. As law agent to the Irish Society, Cairnes had influential friends in London, and he received a favourable response from William, who promised supplies and sent Cairnes back with a warrant to inquire into the city's defences. On his arrival (April), Cairnes met officers and others fleeing the city; he was able to persuade them to return, and strengthened the resolve of the inhabitants to stand firm. With a few others on the city council, Cairnes attacked the governor, Robert Lundy (qv), for his pessimism about the city's ability to withstand a siege; Lundy ordered the English regiments to leave and recommended surrendering the city. Cairnes supported a mutiny against Lundy, whom he probably believed had actually betrayed the city, though Lundy was allowed to escape in disguise. At great risk, Cairnes travelled back to London to alert the king to the events in Derry. His ship was attacked by two French warships, and though he and the crew escaped when they ran aground on the Mull of Kintyre, the vessel was lost. It may have been Cairnes who brought back William's instructions to Gen. Kirke (qv). He is said to have been back in Derry in June, and to have displayed personal valour in a skirmish at the Old Windmill. After the end of the war, the Irish Society appointed Cairnes to be general agent and also commissioner for the rebuilding of Derry and Coleraine.
Cairnes was MP for the city (1692–3, 1695–9) and recorder from 1705. He died in 1722 (May and December appear in different sources). His long and informative will contains his own assessment of his role in preserving Derry and the protestant interest in Ireland, and records that his life was at risk in many ‘sore and most dangerous journeys’. His house in Derry was destroyed by a shell, his Knockmany property was looted, and ‘reasonable expectations’ of compensation for his expenses and losses, which totalled almost £9,000, were never met by the government. Cairnes died a bitterly disappointed man, who regretted that he was unable to leave his family better provided. His second wife, Mary Barnes or Baines (whom he may have married in Dublin 23 March 1684), died young; two daughters from the two marriages survived into adulthood. Several children died young, and a son died in March 1719 in a duel in Newcastle, England, greatly to his father's sorrow and displeasure. William Cairnes (1664?–1740), David's nephew, fought as a captain at the battle of the Boyne; the male line of the family died out with him. John Elliott Cairnes and William Plunket Cairnes (qv) were descendants of a niece whose family took the Cairnes surname. Hugh McCalmont Cairns (qv) was also related. During his 1689 visit to London, Cairnes had his portrait painted by Kneller.