Tenjin (kami)
In the Shinto religion of Japan, Tenjin (天神), also called Tenman Daijizai Tenjin (天満大自在天神), is the patron kami (deity) of academics, scholarship, of learning, and of the intelligentsia.
Tenjin is the deification of Sugawara no Michizane (845–903), a famous scholar, poet and politician of the Heian period.
The name is made of two parts. Ten (天) means sky or heaven, and jin (神) means god or deity.
Sugawara no Michizane
In Japanese history, Sugawara no Michizane rose high in the government in the late 9th century. At the start of the 10th century, he became the victim of a rival from the Fujiwara clan. He was demoted and sent into exile in Kyushu, where he died in 903. Michizane was one of the leading scholars and poets of his time. Later, many misfortunes struck the capital. People believed these were caused by Michizane's angry spirit, called an onryō (vengeful spirit). To calm it, the Emperor restored Michizane's offices and ordered that he be worshiped under the name Tenjin, which means "sky deity."
Over time, the belief that Michizane's spirit was a tenjin spread widely. A new worship group, Tenjin Shinkō, combined older beliefs about a thunder and weather deity, to whom Emperor Kanmu had once prayed, with Michizane's spirit and the Buddhist role of protector of the Dharma. A shrine was established at Kitano. It was the first rank of official shrines and was supported directly by the government.
Evolution into the patron of scholars
For the first few centuries, Tenjin was seen as a god of natural disasters, worshiped to calm him and avoid his curses. However, Michizane was a famous poet and scholar in his lifetime, one of the greatest of the Heian period. In the Edo period, scholars and educators came to regard him as a patron of scholarship. Today, this view has completely pushed natural disasters aside in popular worship.
Tenjin's influence is now regarded as especially strong in passing exams. Many school students and their parents pray for success at his shrine before important entrance exams, and return afterward, if appropriate, to give thanks for success.
Things related to Tenjin
Michizane was very fond of ume trees. While he was in exile, he wrote a famous poem about missing a tree he had loved in the capital. Legend says the tree flew from Kyoto to Dazaifu in Kyushu to be with him, and the tree is still on show at his shrine there. Because of this, shrines to Tenjin are often planted with many ume trees. These trees blossom in February, around the same time exam results are announced, so Tenjin shrines often hold a festival at this time.
The animal most closely linked with Tenjin is the bull. According to legend, during Michizane's funeral procession, the bull pulling the cart carrying his remains refused to go any further than a certain spot, and that spot was later built up into his shrine. After his death, Michizane's spirit was also given the title "Tenman Daijizai Tenjin," which is said to mix the power of his spirit with Daijizai Tenjin.
Shrines
Main article: Tenman-gū
The main shrines to this kami are Kitano Tenman-gū in Kyoto and Dazaifu Tenman-gū in Fukuoka Prefecture. The top three are rounded out by Egara Tenjin Shrine in Kamakura, but there are many other shrines dedicated to him across Japan. These shrines are called Tenman-gū (天満宮).
A group of three notable shrines has been called the Three Great Tenjin Shrines.
Worship
Sugawara no Michizane is associated with luck in exams. On February 25, his memorial day, ceremonies are held at temples across Japan. These ceremonies are considered to bring benefits for exams.
When the shrines are called the "Three Great Tenjin Shrines", Dazaifu Tenmangu is sometimes left out and Kitano Tenmangu is kept in.

Quiz time!
5 questions about Tenjin (kami)
Why are shrines to Tenjin often planted with many ume trees?
Pictures
Keep exploring
This article is a child-friendly adaptation of the Wikipedia article on Tenjin (kami), available under CC BY-SA 4.0.
Images from Wikimedia Commons. Tap any image to view credits and license.