"Kimi" has been used either as a noun to indicate an emperor or one's lord (i.e., master) since at least the Heian period. For example, the protagonist Hikaru Genji (光源氏) of the Tale of Genji is also called "Hikaru no Kimi" or "Hikaru-gimi" (光の君 or 光君). But before the Nara period, the emperor was often called "ōkimi" (great lord); so it is controversial whether the word "kimi" in "kimigayo" had meant emperor or not originally.
In the Kamakura period, "Kimigayo" was used as a festive song among samurai and then became popular among the people in the Edo period. In the later part of the Edo period, "Kimigayo" was used in the Ōoku (harem of Edo Castle) and Satsuma-han (now Kagoshima Prefecture) as a common festive new year song. In those contexts, "kimi" never meant the emperor but only the Tokugawa shōgun, the Shimazu clan as rulers of the Satsuma-han, guests of honor or all members of festive drinking party. After the Meiji Restoration, samurai from Satsuma-han controlled the Imperial Japanese government and they adopted "Kimigayo" as the national anthem of Japan. From this time until the Japanese defeat in World War II, "Kimigayo" was understood to mean the long reign of the emperor. With the adoption of the Constitution of Japan in 1947, the emperor became no longer a sovereign who ruled by divine right, but a human who is a symbol of the state and of the unity of the people. The Ministry of Education did not give any new meanings for "Kimigayo" after the war; this allowed the song to mean the Japanese people. The Ministry also did not formally renounce the pre-war meaning of "Kimigayo".
In 1999, during the deliberations of the Act on National Flag and Anthem, the official definition of Kimi or Kimi-ga-yo was questioned repeatedly. The first suggestion, which was given by Chief Cabinet Secretary Hiromu Nonaka, stated that kimi meant the "emperor as the symbol of Japan", and that the entire lyrics wish for the peace and prosperity of Japan. He referred to the new status of emperor as established in Article 1 of the Constitution of Japan as the main reason for these suggestions. During the same session, Prime Minister Keizō Obuchi confirmed this meaning with a statement on June 29, 1999:
"Kimi" indicates the Emperor, who is the symbol of the State and of the unity of the people, and whose position is derived from the consensus-based will of Japanese citizens, with whom sovereign power resides. And, the phrase "Kimigayo" indicates our State, Japan, which has the Emperor enthroned as the symbol of the State and of the unity of the people by the consensus-based will of Japanese citizens. And it is reasonable to take the lyric of "Kimigayo" to mean the wish for the lasting prosperity and peace of such country of ours.
Parties opposed to the Liberal Democratic Party, which was in control of the government at the time Obuchi was prime minister, strongly objected to the government's meaning of kimi and "Kimigayo". From the Democratic Party of Japan, members objected, due to the lack of any historical ties to the meaning. The strongest critic was Kazuo Shii, the chairman of the Communist Party of Japan, who strongly claimed that "Japan" could not be derived from "Kimigayo", because the lyrics only mention wishing for the emperor to have a long reign. Shii also objected to the use of the song as the national anthem because for a democratic nation, a song about the emperor is not appropriate.