Samuel Francis Smith wrote the lyrics to "My Country 'Tis of Thee" (also known simply as "America") in 1831 while a student at Andover Theological Seminary. He penned them to commemorate the 50th anniversary of George Washington's inauguration as the first U.S. president (1789).
The melody is identical to the British national anthem, "God Save the King/Queen"—a tune with roots in 18th-century Britain. Smith adapted it for American patriotic use, creating a de facto national anthem that served the U.S. until "The Star-Spangled Banner" was officially adopted in 1931.
The song remains a staple of American civic life—sung at graduations, naturalization ceremonies, and July 4th celebrations.