A national anthem is a generally patriotic musical composition that is evoking and eulogizing the history, traditions and struggles of its people, recognized either by a nation's government as the official national song, or by convention through use by the people.
Anthems rose to prominence in Europe during the nineteenth century; the oldest national anthem is "Het Wilhelmus", the Dutch national anthem, written between 1568 and 1572 during the Eighty Years' War. It should be noted that the Japanese national anthem has older lyrics, but the melody wasn't added until the early 20th century, making it a poem, and not an anthem, for most of its existence.
God Save the Queen/King, the national anthem of the United Kingdom, was first performed in 1745 under the title "God Save the King". Spain's national anthem, the "Marcha Real" (The Royal March), dates from 1770. La Marseillaise, the French anthem, was written in 1792 and adopted in 1795.
During the rise of the national state in the nineteenth and twentieth centuries, most remaining nations adopted an anthem upon attaining nationhood. Because of European colonial influence, many were influenced in a similar way to adopt a national anthem, and thus several anthems outside Europe are in the European style. Only a handful of non-European countries have anthems rooted in indigenous traditions, including China, Japan, Costa Rica, Iran, Sri Lanka, and Myanmar.
An anthem can become a country's national anthem by a provision in the country's constitution (such as in France), by a law enacted by its legislature (as in the United States), or simply by tradition (as is the case in the United Kingdom).
The majority of national anthems are either marches or hymns in style. The countries of Latin America tend towards more operatic pieces, while a handful of countries use a simple fanfare. Anthems by their nature have to be brief (the average is about one minute in length), yet many, if not most, manage to make them musically significant, and a true representation of the nation's musical character.
National anthems are usually either in the most common language or languages of the country, whether de facto or official. Pakistan's anthem, however, is not in Urdu but in Persian. India's anthem is a highly Sanskritized version of Bengali. South Africa's national anthem is unique in that five of the eleven official languages are used in the same anthem (each language comprising a stanza).