A tamagaki (玉垣) is a fence surrounding a Japanese Shinto shrine, a sacred area or an imperial palace. Believed to have been initially just a brushwood barrier of trees, tamagaki have since been made of a variety of materials including wood, stone and—in recent years—concrete. Depending on the material and technique utilized, such fences have a variety of names:
The simple fences of ancient and medieval times became more elaborate in pre-modern Japan with the addition of roofs, wainscoting and grilles between posts. An example is the 1636 Tōzai Sukibei (東西透塀) around the main sanctuary of Nikkō Tōshō-gū.
If the enclosed area is surrounded by multiple fences, generally the innermost one is called mizugaki (瑞垣 or 瑞籬). The inner sanctuary (内宮, naikū) of Ise Grand Shrine is surrounded by four fences. From outside to inside these are: itagaki (板垣), outer and inner tamagaki and mizugaki. At Ise these fences separate areas for worshipers of different status. All visitors are allowed to pass a gate through the outermost itagaki fence, while traditionally only members of the imperial family were allowed to pass through the second fence, the outer tamagaki. Today this privilege has been extended to elected representatives. Local mayors and members of assemblies worship at the inner eaves of the outer tamagaki, representatives of prefectural governments, officials of Ise Shrine and Living National Treasures stand halfway between the outer and inner tamagaki. The prime minister, members of both chambers of the diet, and other senior elected officials are allowed to the point just outside the gateway to the inner tamagaki. Entrance to the inner tamagaki is limited to members of the imperial family and only the emperor and the empress are generally allowed to enter through the innermost mizugaki fence.[nb 1]
The tamagaki and the traditional torii gate are sometimes replaced by a covered corridor called kairō and a rōmon gate. Originally Buddhist, neither was initially typical of shrines, but in time they often came to play the role of the more traditional tamagaki. A famous example is Iwashimizu Hachiman-gū in Kyoto prefecture. This phenomenon was partly caused by the strong influence of Buddhism on kami worship due to the syncretic fusion of Buddhism and local religion (shinbutsu shūgō).