The Department of Divinities, also known as the Department of Shinto Affairs, Department of Rites, Department of Worship, as well as Council of Divinities, was a Japanese Imperial bureaucracy established in the 8th century, as part of the ritsuryō reforms. It was first consolidated under Taihō Code which established the Department of Divinities and Daijō-kan, the Council of State. However, the department and Daijō-kan made its first appearance in the Asuka Kiyomihara Code.
While Daijō-kan handled secular administrative affairs of the country, Jingi-kan oversaw almost all matters related to Shintō, particularly of kami worship. In other words, the general function of jingi-kan includes to oversee kami-related affairs at court, provincial shrines, performance rites for the celestial and terrestrial deities, as well as coordinating the provinces' ritual practices with those in the capital based on a code called 神祇令, which roughly translates to "Code of Celestial and Terrestrial Deities" or "Code of Heavenly and Earthly Gods".
While the department existed for almost a century, there are periods of time in Japanese ancient and medieval history where jingi-kan was effectively inexistent, parallel to the evolution of the ritsuryō system and Shinto, such as when the establishment of jingi-kan was burned down during Ōnin War (1467-1477). Then, during the Meiji period, jingi-kan was briefly reinstated in 1868 and then dissolved in 1871, succeeded by Ministry of Divinities and Ministry of Religion (教部省, kyōbushō).
The term jingi-kan is composed of the Chinese character 官, "council" or "department," and 神祇, which is an abbreviated form of 天神地祇, "celestial and terrestrial deities." The term 天神, also known as amatsukami which translates to "celestial deities" or "heavenly gods" encompasses all kami gods in Shinto that resides in Takamagahara or "High Plains of Heaven," from whom the Japanese imperial line supposedly descended. The term 地祇, also known as kunitsukami, translates to "terrestrial deities" or "earthly gods" and encompasses all kami gods in Shinto that resides in or have appeared on the earth.