Emperor Kammu (桓武天皇) was the 50th imperial ruler of Japan.
During his reign the capital of Japan was moved from Heijo, near Nara, first to Nagaoka, and then to Heian. This marks the beginning of the Heian era in Japanese history. He was an active emperor who set up new government organisations and fought the Ezo tribes in the north of the country.
Earlier Imperial sponsorship of Buddhism, beginning with Prince Shōtoku (574-622), had lead to a general politicization of the clergy, along with an increase in intrigue and corruption. In 784 Kanmu shifted his capital from Nara to Nagaoka in a move that was said to be designed to edge the powerful Nara Buddhist establishments out of state politics - while the capital moved, the major Buddhist temples, and their officials, stayed put. Indeed there were a steady stream of edicts issued from 771 right through the period of Kukai's studies which, for instance, sought to limit the number of Buddhist priests, and the building of clan temples. However the move was to prove disastrous and was followed by a series of natural disasters including the flooding of half the city. In 785 the principle architect of the new capital, and royal favourite, Fujiwara no Tanetsugu, was assassinated.
Meanwhile Kanmu's armies were pushing back the boundaries of his empire. This led to an uprising, and in 789 a substantial defeat for Kanmu's troops. Also in 789 there was a severe draught and famine - the streets of the capital were clogged with the sick, and people avoiding being drafted into the military, or into forced labour. Many disguised themselves as Buddhist priests for the same reason. Then in 794 Kanmu suddenly shifted the capital again, this time to Heiankyoo, which is modern day Kyoto. The new capital was started early the previous year, but the change was abrupt and led to even more confusion amongst the populous.
Politically Kanmu shored up his rule by changing the syllabus of the university. Confucian ideology still provided the raison d'Ítre for the Imperial government. In 784 Kanmu authorised the teaching of a new course based on the Spring and Autumn Annals based on two newly imported commentaries: Kung-yang, and Ku-liang. These commentaries used political rhetoric and promote a state in which the Emperor as "son of Heaven" should extent his sphere of influence to barbarous lands, thereby gladdening the people. In 798 the two commentaries became required reading at the government university.
Kammu also sponsored the travels of the monks Saicho and Kukai to China, from where they returned to found the Japanese branches of, respectively, Tendai and Shingon Buddhism.