The Heian Palace (平安宮 Heian-kyū?) or Daidairi (大内裏?) was the original imperial palace of Heian-kyō (present-day Kyoto), the capital of Japan, from 794 to 1227. The palace, which served as the imperial residence and the administrative centre of for most of the Heian period (from 794 to 1185), was located at the north-central location of the city in accordance with the Chinese models used for the design of the capital.
The palace consisted of a large rectangular walled enclosure, which contained several ceremonial and administrative buildings including the government ministries. Inside this enclosure was the separately walled residential compound of the emperor or the Inner Palace (Dairi). In addition to the emperor's living quarters, the Inner Palace contained the residences of the imperial consorts, as well as certain official and ceremonial buildings more closely linked to the person of the emperor.
The original role of the palace was to manifest the centralised government model adopted by Japan from China in the 7th century—the Daijō-kan and its subsidiary Eight Ministries. The palace was designed to provide an appropriate setting for the emperor's residence, the conduct of great affairs of state, and the accompanying ceremonies. While the residential function of the palace continued until the 12th century, the facilities built for grand state ceremonies began to fall into disuse by the 9th century. This was due to both the abandonment of several statutory ceremonies and procedures and the transfer of several remaining ceremonies into the smaller-scale setting of the Inner Palace.