David Martin was born in Anstruther, Fife, the son of a schoolmaster. He trained under Allan Ramsay, working in his fellow Scot's London studio from about 1752. In 1755 he joined Ramsay in Rome and probably returned with him to London in 1757, working as his chief assistant, producing copies of state portraits. He settled in Edinburgh in the mid 1780s where his successful portrait practice functioned as a key link between his master, Ramsay, and Henry Raeburn. One of Martin's earliest independent works is a portrait of Benjamin Franklin (1767), which now hangs in The White House, Washington.