Tenjin is the Shinto kami of scholarship. He originated from a Heian period scholar, politician, and poet named Sugawara no Michizane (菅原道真). Sugawara was a very important figure in the government until the beginning of the tenth century when a political rival, Fujiwara no Tokihira, caused him to be demoted from his aristocratic rank and exiled to Kyushu. He died in 903, and shortly after disaster began. Plague, heavy storms, flooding, and fires ravaged the city, and the Imperial Palace was struck by lightning. Concluding this was due to Sugawara’s angry spirit, the imperial court posthumously restored his offices and rescinded his exile. A shrine dedicated to him was established, and he was worshiped as the kami Tenjin.
Initially, Tenjin was worshiped in order to calm his spirit and avoid his curses. However, because he was a great poet and scholar in his time, he became regarded as the kami of scholarship. Today it is common for students to visit shrines dedicated to Tenjin when hoping for success on entrance exams.