"Yamashiro" was formerly written with the characters meaning "mountain" () and "era" (); in the 7th century, there were things built listing the name of the province with the characters for "mountain" and "ridge"/"back" (). On 4 December 794 (8 Shimotsuki, 13th year of Enryaku), at the time of the establishment of Heian-kyō, because Emperor Kanmu made his new capital utilize the surroundings as natural fortification, the character for "shiro" was finally changed to "castle" (). Later "shiro" from the province name replaced the older "ki" as the Japanese reading for the character 城.