James Mcpherson was the leader of a gang of cattle-thieves in the north-east of Scotland. He was eventually captured and found guilty of theft at Banff, where he was sentenced to death by hanging. Before his execution he played a tune on his fiddle, ‘Mcpherson’s Rant’, the air to which this song is set, and then smashed his instrument in front of the crowd.
Burns played upon these events to provide the words for his song, and in a letter to George Thomson related to him that he wrote almost everything himself, except for the chorus and one stanza, which he took from a broadside ballad printed after the affair called, Mcpherson’s Rant; or the Last Words of James Mcpherson, Murderer. It is notable that Burns somewhat romanticizes the position of Mcpherson, and endows him with a heroic quality absent in most of the material which relates to him. Burns’s version was first published in James Johnson’s Scots Musical Museum (1788).