Ujisha is a shrine in which ujigami (ancestors of a family who were worshiped as a god) was worshipped.
In the ancient days, there were some cases where shucho (the head of a community) worshipped a local god and conducted festivals, and where shucho who was qualified by the Yamato sovereignty (the ancient Japan sovereignty) as ujigami (the head of the ancestor of a family) led the festivals in a national-festival form. However, in those days, a god worshipped by ujigami was not always the original member of the clan, and the element of belief concerning the land and occupations was stronger than the element concerning the blood relations. It is considered that, one person might also belong to a plurality of blood-related groups in the ancient days because connections as a family originated from blood relations not only in the paternal line but also in the maternal line were also existed and, therefore, elements such as local relations were added and a festival zone to which one person belongs was determined.
At the start of the eighth century when the ritsuryo system (a system of centralized government based on the ritsuryo code) was established, the clan system itself gradually changed. The powerful families in Kinai area were given official ranks in Kyoto and were separated from their original territories. Grouping by original line based on the paternal line through a hidden ranking system, etc., was advanced, and ujigami as a guardian god of those who were from the same ancestors through their paternal lines and ujisha which worshipped this ujigami was established. Typical ujisha include: Kasuga-taisha Shrine at which Fujiwara clan invited their guardian gods, Kajima no Kami and Katori no Kami and worshipped them together with Amako no Mikoto and Hiuri no Kami who were the starting ancestors of the two; Umemiya-jinja Shrine at which Tachibana clan worshipped as a guardian god of the clan a god whom their starting ancestor, TACHIBANA no Michiyo worshipped; and Hirano-taisha Shrine which was worshipped by persons who were maternal relatives and descendants of the Emperor Kanmu. All of these families were clans that were established or developed under the ritsuryo system and, in these families, formation of groups by paternal line was actively deployed.
In small or medium scaled powerful families in the Kinai area and among local powerful families, ujigami was believed to be an extension of the conventional belief, however, in the late Heian period when the shoen-koryo system (a manor and public territory system) was established and the handing down of territories and properties between fathers and children became common, the conventional manner of ujigami worship in each clan collapsed and, when territory management by 'family' as a unit gradually became common, chien-gami god (the locally connected god) of each territory or ubutsuchi-gami god (soil producing god) of one's home town was worshipped as ujigami and, as this confusion advanced, new ujigami were established in various places. In addition, no single ujigami was worshiped in each community but some ujigami of families in an area were made common and, as a result, 'chinju' (village shrine) was established in each area as the guardian god and ujisha in the whole local community. This developed into a relation between ujigami and ujiko (supporters of ujigami) that can be seen today.