The sūtra named Que wenhuang shenzhou jing却温黄神呪経 contains a method for curing epidemics accompanied by high fever. This method was to recite the names of seven kijin鬼神 demons to eliminate the invisible epidemic. In later times it was believed that enshrining the seven kijin demons or Matari-jin摩怛利神 and reading this text would prevent epidemics. The names of Matari-jinja摩怛利神社 or Shichiki-jinja七鬼神社 shrines remain to the present day.
This paper discusses how the demons in the sūtra are connected to faith in Matari-jin as it developed from the Que wenhuang shenzhou jing. As mentioned above, seven demons are taught in the Que wenhuang shenzhou jing. The Shichi-Kijin七鬼神 painting in the Kyoto City University of Arts is one example of faith in Matari-jin, and can be traced back to the Shichimonyo-ten maṇḍala七母女天曼荼羅 taught in the thirteenth chapter of the Liqu jing理趣経. That is to say, the Shichi-Kijin painting and the Shichimonyo-ten maṇḍala both have Makakyara-ten摩訶迦羅天 as their central deity, with the seven kijin demons painted around him. This Makakyara-ten is Mahākāla, who manifests as Matari-jin, the god of epidemics.
The Que wenhuang shenzhou jing and esoteric Buddhist practice are deeply involved in the background to this faith in Matari-jin, and this sūtra was read and Matari-jin was worshipped to dispel epidemics.