"Over the Hills and Far Away" is a traditional British song, dating back to at least the late 17th century. One version was published in Thomas D'Urfey's Wit and Mirth, or Pills to Purge Melancholy; a very different one appeared in George Farquhar's 1706 play The Recruiting Officer. A version also appears in John Gay's The Beggar's Opera of 1728.
The words have changed over the years, as can be seen in the versions below. The only consistent element in early versions is the title line and the tune. D'Urfey's and Gay's versions both refer to lovers, while Farquhar's version refers to fleeing overseas to join the army. The tune was provided with another set of lyrics for the British Sharpe television series of the 1990s, based on Farquhar's version. This version was also recorded by John Tams who played Dan Hagman in the series.
The nursery rhyme "Tom, Tom, the Piper's Son" mentions a piper who knows only one tune, this one. Early versions of this, known as "The distracted Jockey's Lamentations", may have been written (but not included) in Thomas D'Urfey's play The Campaigners (1698):
Another nursery rhyme "Five Little Ducks" uses the title of the song as a line.
[verses omitted]
A version of the lyrics by George Farquhar for his play The Recruiting Officer from 1706.
In The Beggar's Opera the song is a duet between the antihero Macheath and his lover Polly. It is a romantic dream of escape, with no military references.
MACHEATH:
POLLY:
MACHEATH:
POLLY:
MACHEATH:
POLLY:
This is the version that is used in the Sharpe movies, written by John Tams. Note that each verse is from a different movie, as noted at the start of the verse.