David Leslie was born on 5 May 1660, the third son of George Melville, 1st Earl of Melville. His mother was Catherine Leslie, daughter of Alexander Leslie, Lord Balgonie. David was born with the family name Melville. On 27 July 1681 he inherited the titles 5th Lord Balgonie and 5th Earl of Leven (some sources say 3rd Earl of Leven, but thepeerage.com records him as the 5th Earl). This inheritance followed the death of John Leslie, 1st Duke of Rothes, who died without male issue, and it was at this point that David appears to have changed his surname from Melville to Leslie.
The Melvilles were implicated in the Rye House Plot of 1683 to assassinate King Charles II and his brother James, and were also involved with the Duke of Monmouth. As a result, David had to flee the country. He settled in the Netherlands and joined the Protestant exiles under the patronage of William of Orange. While in Europe he raised a regiment and took part in William’s invasion of England, during which he received the surrender of Plymouth. When he raised the regiment that became the King’s Own Scottish Borderers, he incorporated the men he had commanded in the Netherlands. He held the rank of Colonel at that time.
He commanded the regiment at the Battle of Killiecrankie and was appointed Commissioner for the Pacification of the Highlands in 1689. He also held the posts of Keeper and Governor of Edinburgh Castle, Governor of the Bank of Scotland, and Commander-in-Chief, Scotland. He was a lieutenant-general in 1707, the year of the Act of Union with England. He married Lady Anne Wemyss on 3 September 1691, and they had a daughter, Lady Mary Leslie, and two sons: George Leslie, Lord Balgonie, and Alexander Leslie, 7th Earl of Leven. David, Earl of Leven, died on 6 June 1728.