The Imperial Court in Kyoto was the nominal ruling government of Japan from 794 AD until the Meiji period (1868–1912), after which the court was moved from Kyoto to Tokyo and integrated into the Meiji government. Upon the court being moved to Kyoto from Nagaoka by Emperor Kanmu (737–806), the struggles for power regarding the throne that had characterized the Nara period diminished. Kyoto was selected as the location for the court because of its "proper" amount of rivers and mountains which were believed to be the most auspicious surroundings for the new capital. The capital itself was built in imitation of Chang'an, the Chinese capital of the Tang dynasty, closely following the theories of yin-yang. The most prominent group of people within the court was the civil aristocracy (kuge) which was the ruling class of society that exercised power on behalf of the emperor.