Originally a sacred space of the native Ryukyuan religion, due to its location and natural beauty, it was dedicated to nirai kanai, the mythical source of all life, and to the sea.
At some point it came to be known as Hana gusuku and Nanminsan; Nanmin is the Okinawan reading of 波上, meaning "above the waves", which is pronounced as Naminoue in standard Japanese.
According to the historical document Ryūkyū-koku yurai-ki (琉球国由来記, "Record of the Origin of the Kingdom of Ryūkyū), a Buddhist temple was founded on the site, to be associated with the shrine, in 1367, by Raijū, a monk from Japan's Satsuma province.
The shrine then came to be associated with the protection of the many ships coming and going from Naha's port, as Okinawa's trade with Korea, China, Japan, and regions to the south expanded.
[2] Following the Meiji Restoration, the Ryūkyū Kingdom was dissolved and formally annexed by Japan as Okinawa Prefecture.