was the capital of Japan from 784 to 794. Its location was in Otokuni District, Yamashiro Province, corresponding to a 4.3 x 5.3 kilometer area spanning the borders of the modern cities of Mukà  and Nagaokakyà Â, Kyoto, the town of à Âyamazaki, and the Nishikyà Â-ku ward of the city of Kyoto. The ruins of the palace have been found in the Kaidecho neighbourhood of the city of Mukà  and have been designated as a National Historic Site since 1964, with the area under protection expanded in 2016.
Nagaoka-kyà  was built by order of Emperor Kanmu, who instructed that the new capital be established 40 kilometers north of Heijà Â-kyà  in an attempt to overcome Heijà Â-kyà Â's various geographical weaknesses. Nagaoka-kyà  was situated at the confluence point of three major rivers, where the Katsura River and Uji River formed the Yodo River. A port called Yamazakitsu was established to unload goods from all over the country, where they were transferred to small ships. This made it easy to transport supplies efficiently by boat to Nagaoka-kyà Â, whereas Heijà Â-kyà  could only be reached by land routes. In addition, Ogura Pond, which existed at the time to the southeast of Nagaoka-kyà Â, was expected to be used as a logistics base.
Archaeological excavations have revealed that almost every house in Nagaoka-kyà  had a well, and measures were also taken to deal with sewage, both of which had been problems in Heijà Â-kyà Â. Running water from the side of the road was drawn into houses to flush away excrement. The natural spring water from the northwest of Nagaoka-kyà  naturally flowed southeast through the city, which was built on a gentle slope, and this washed away filth into the river, keeping the city clean.
The imperial palace was situated on a minor plateau 15 meters higher than the city, visually demonstrating the authority of the emperor, whereas Heijà Â-kyà  was completely flat. Furthermore, the main seaport of Naniwa-tsu on the Seto Inland Sea had silted up and was increasingly unusable. The location of Nagaoka-kyà  facilitated the development of a new route via the Kanzaki River towards Lake Biwa and Omi Province.
The new capital was also intended to rectify Heijà Â-kyà Â's various political weaknesses. Per the Shoku Nihongi, Emperor Kanmu consulted closely with Fujiwara no Tanetsugu on the location of the new capital. Nagaoka happened to be Tanetsugu's family home, and a strong support base for the Fujiwara clan. Other reasons included a desire for distance from the increasingly politicized clergy of the great Buddhist establishments in Heijà Â-kyà Â, and a desire to improve relations with the economically powerful toraijin immigrant clans of southern Yamashiro Province from whom his mother was descended.
New Year's ceremonies were held at the Nagaoka-kyà  palace on New Year's Day in 785, which means that the palace was completed only six months after construction of the capital began. The construction of the palace was undertaken with consideration to opposition from the people of Heijà Â-kyà  at the relocation of the capital. At that time, it was common for palaces to be built by demolishing the original structures and relocating the buildings to the new site; however, in the case of Nagaoka-kyà Â, the structures of Heijà Â-kyà  were left intact in situ, and the Naniwa-kyà  palace was relocated instead.
Nonetheless, in September of the same year, Fujiwara no Tanetsugu was assassinated, and several officials associated with the great state temple of Tà Âdai-ji were implicated. Emperor Kanmu's younger brother, Imperial Prince Sawara, was also imprisoned and exiled because of his strong opposition to the move of the capital. The prince died while en route to his exile, still harboring a grudge. After his death, various incidents occurred in 792, such as famine and epidemics due to drought, the successive deaths of the Empress and other close relatives of Emperor Kanmu, arson of the main hall of Ise Grand Shrine, and the onset of illness of the Crown Prince. The following year, an onmyà Âji declared that these disasters were caused by the onryà Â, or vengeful spirit of Prince Sawara. Despite efforts at appeasing the prince's spirit, heavy rains followed by floods caused great damage to Nagaoka-kyà Â. Wake no Kiyomaro, the aristocrat in charge of flood control proposed relocation of the capital. A new site was selected to the northeast in 793 and the capital officially relocated to Heian-kyà  in 794.
After the transfer of the capital, the former Nagaoka-kyà  area became the domain of Sugawara no Michizane, and the Nagaoka Tenman-gu Shinto shrine was constructed after his exile in 901. Although the name of "Nagaoka" survived as a place name, the actual site of the palace was lost for many centuries. The site of the palace was only re-discovered in 1954 and extensive archaeological excavations have been conducted since.