He held several positions in the royal court starting in his youth. He moved to Tokyo after the Meiji Restoration and in 1875 helped carry out 1875 orders to fuse Western musical theory with Japanese theory. The final version of the anthem was first played for Emperor Meiji for his birthday, on 3 November 1880.
Sources conflict over who composed the music. Historian Emiko Ohnuki-Tierney writes, "The composer is nominally identified as Hayashi Hiromori, a musician at the Imperial Court, but Oku Yoshiisa, who worked under Hayashi, is believed to have composed the music, with some rearrangement by Franz Eckert (1852–1916)." The melody that Hayashi was credited for replaced an arrangement by John William Fenton, a visiting Irish military band leader, that was rejected in 1870. The Court then adopted a new melody composed by Yoshiisa Oku and Akimori Hayashi. The composer is often listed as Hiromori Hayashi, who was their supervisor and Akimori's father. Akimori was also one of Fenton's pupils. The German musician Franz Eckert applied the melody with Western style harmony.