The words were taken from a tanka (31-syllable poem) found in the Kokin-wakashu, a 10th-century anthology of poems. The music was composed in 1880 by Hiromori Hayashi, an Imperial Court musician and was later harmonized according to the Gregorian mode by Franz Eckert, a German bandmaster. "Kimigayo (The Emperor's Reign)" became Japan's national anthem in 1888.
The word "kimi" refers to the Emperor and the words contain the prayer: "May the Emperor's reign last forever." The poem was composed in the era when the Emperor reigned over the people. During WWII, Japan was an absolute monarchy which moved the Emperor to the top. The Japanese Imperial Army invaded many Asian countries. The motivation was that they were fighting for the holy Emperor.
After WWII, the Emperor became the symbol of Japan by the Constitution, and has lost all political power. Since then various objections have been raised about singing "Kimigayo" as a national anthem. However, at present it remains sung at national festivals, international events, schools, and on national holidays.
The words of "Kimigayo":
May the reign of the Emperorcontinue for a thousand, nay, eight thousand generationsand for the eternity that it takesfor small pebbles to grow into a great rockand become covered with moss.