My country 'tis of thee,

Sweet land of liberty...

Although we know that Reverend Samuel Francis Smith wrote the words to "My Country 'Tis of Thee" (also known as "America"), the origin of the song's melody remains a mystery. And the history of its verses is even more complex.

The son of Henry Carey, a British singer-composer, claimed his father was the first to compose both the words and the music of this tune as "God Save Great George the King" in London in 1740. However, Carey's son had financial reasons for making such a claim, and music historians argued it was more likely any such tune would have been based on a pre-existing melody.

Such an earlier melody, if it did exist, has been attributed to various seventeenth-century sources including the English composer John Bull, the French court composer Jean-Baptiste Lully, and even a military hymn from Switzerland. Although the tune's exact origin is not confirmed, it was printed in England in 1744 in the tune book Thesaurus Musicus.

The performance that led to an explosion in the popularity of "God Save the King" took place in London in September 1745. Dr. Thomas Arne arranged the tune for a September 28, 1745, performance at the Drury Lane Theater. It was also performed concurrently at the Covent Garden Theater for several nights running. The song was intended to show support for the Hanoverian King George II, following the defeat of his General John Cope at Prestonpans, a battle that was the opening salvo in the war against "Bonnie Prince Charlie," his Stuart rival for the throne.

Before the music of "My Country 'Tis of Thee" made its way to the United States it was played in many countries. By the 1790s the melody had become that of the Danish national anthem "A Song to be Sung by the Danish Subjects at the Fete of their King, to the Melody of the English Hymn." Eventually it also became the national anthem of at least six other places, including Prussia ("Heil dir im Siegerkranz" or "Hail to Thee in the Victor's Wreath"), Britain ("God Save the Queen") and Liechtenstein.

The first documented version of this melody printed in the American British colonies dates from 1761. The tune of "God Save the King" was used, in a slightly modified form, as the melody for the hymn known as "Whitefield's Tune," published in Urania, a collection of sacred songs compiled by James Lyon and printed by William Bradford.

After the colonies became independent from England the words were further adapted for use in the United States. For example, George Washington was greeted as he arrived in New York City for his first inauguration in April 1789, with the following homegrown words sung to the familiar air of "God Save the King."

Hail, thou auspicious day!

For let America

Thy praise resound.

Joy to our native land!

Let every heart expand,

For Washington's at hand,

With glory crowned.

Thrice beloved Columbia, hail!

Behold before the gale

Your chief advance.

The matchless Hero's neigh;

Applaud him to the sky,

Who gave you liberty,

With gen'rous France.

A number of popular versions of the song may have evolved in America, with no known documentation as to their source. It would have been known, for example, to many members of the Lewis and Clark expedition (1803-1806) under the title "God Keep America."

God keep America

Free from tyrannic sway

Till time shall cease

Hush'd be the din of arms

And all proud war's alarm;

Follow in all her charms

Heaven-borne peace.

The words that eventually became a tradition, particularly among U.S. school children, were written by Samuel Francis Smith while he was studying at Andover Theological Seminary in 1831. Smith was approached by the famed organist and composer Lowell Mason who had with him some German school music books. Mason wanted Smith to either translate the German, or write new text for the tunes. Smith was particularly struck by one tune (most likely unaware that it was the same melody as "God Save the King") and wrote his lyrics to it. The song was debuted by Mason on July 4, 1831, at a children's service at the Park Street Church in Boston, Massachusetts.

Smith initially wrote another verse, which he cut because it seemed too strident and not in keeping with what he wanted to be a peaceful homage to the nation. Beethoven and Haydn have incorporated the music of this song into their own work and, on August 28, 1963, Rev. Martin Luther King quoted Smith's lyrics when he stated from the steps of the Lincoln Memorial "I have a dream" and called on the nation to "let freedom ring."