Tenjin is the deification of Sugawara no Michizane (845–903), the famous scholar, poet and politician of the Heian period.
The court of the Emperor drew the conclusion that the disturbances were caused by Michizane's onryō (怨霊, vengeful spirit), and, to placate it, the Emperor restored all Michizane's offices, burned the official order of exile, and ordered that the poet be worshiped under the name Tenjin, which means sky deity.
For the first few centuries, then, Tenjin was seen as a god of natural disasters, worshiped to placate him and avoid his curses.
By the present day, this view has completely eclipsed natural disasters in popular worship.
[4] On February 25, which is Sugawara no Michizane's memorial day, ceremonies are held at temples across Japan.