The earliest printed versions of this tune date from 1792 in Scotland and England. It appeared in American publications almost immediately thereafter. There is also an Irish reel with the same title.
This melody first appeared in a manuscript copybook from 1780 to 1804 that was written by John Fife, a fiddler who was possibly from Perthshire, Scotland. He traveled at sea during the time in which he worked on this copybook, so the tune may also have originated from another area. Someone once communicated to me that the tune was about the 1917 Halifax explosion, although it clearly very much predates that event and I cannot now find any reference for this claim.