 Johnston was born on 19 January 1764 at Annan, Dumfriesshire, Scotland, the son of Captain George Johnston, aide-de-camp to Lord Percy, later the 5th Duke of Northumberland.Percy obtained a commission for the 12-year-old Johnston as second lieutenant of marines on 6 March 1776.Johnston went to America with his regiment, and took part in the Battle of Bunker Hill during the American Revolutionary War, where he distinguished himself by seizing the colours and carrying them into action after the standard-bearer had been mortally wounded.