The Heian period (平安時代, Heian jidai?) is the last division of classical Japanese history, running from 794 to 1185. The period is named after the capital city of Heian-kyō, or modern Kyōto. It is the period in Japanese history when Buddhism, Taoism and other Chinese influences were at their height. The Heian period is also considered the peak of the Japanese imperial court and noted for its art, especially poetry and literature. Although the Imperial House of Japan had power on the surface, the real power was in the hands of the Fujiwara clan, a powerful aristocratic family who had intermarried with the imperial family. Many emperors actually had mothers from the Fujiwara family. Heian (平安?) means "peace" in Japanese. 

The Heian period was preceded by the Nara period and began in 794 A.D after the movement of the capital of Japan to Heian-kyō (present day Kyōto京都), by the 50th emperor, Emperor Kanmu. Kanmu first tried to move the capital to Nagaoka-kyō, but a series of disasters befell the city, prompting the emperor to relocate the capital a second time, to Heian. The Heian Period is considered a high point in Japanese culture that later generations have always admired. The period is also noted for the rise of the samurai class, which would eventually take power and start the feudal period of Japan.
who had the power?
 samurai 