Ichinomiya means the first or most important shrine and refers to the main Shinto shrine in a province (the provincial system has been replaced by the present prefectural system). These shrines continue, in most cases, to be among the main Shinto shrines. The granting of special status to important shrines dates back to the 8th century. Just as the emperor was supposed to make offerings at specific important shrines, so too were provincial governors supposed to make offerings (often on behalf of the emperor) at locally important shrines. The early ranking system was formalized in the law codes, one of which singled out over 3,000 shrines and gods.
As time went on and the central government deteriorated, other systems of ranking shrines developed. By the 12th century, there was no formal system, but it was commonly understood that there was a ranking of the shrines in a province; the ichinomiya held precedence over the ninomiya (secondary shrine) and so on. Part of the inspiration for this system was religious, but part of it had to do with official patronage of both Shinto and Buddhist gods, shrines, or temples which had a special relationship with government or which helped protect the state. During the Nara period, the government ordered the building of kokubunji or provincial Buddhist temples throughout the country. They held the responsibility to pray for the protection of the state. To confuse matters, there is a city called Ichinomiya northwest of Nagoya which grew up around an ichinomiya and a city west of Tokyo called Kokubunji which grew up around one of the early kokubunji. There are also cities called Ichinomiya in Hyogo and Chiba prefectures.