From the Wikipedia article:
> Within the abdication of Emperor Uda, Michizane's position became increasingly vulnerable. In 901, through the political maneuverings of his rival, Fujiwara no Tokihira, Michizane was demoted from his aristocratic rank of junior second to a minor official post at Dazaifu, in Kyūshū's Chikuzen Province, and died in exile. After Michizane's death, plague and drought spread and sons of Emperor Daigo died in succession. The Imperial Palace's Great Audience Hall (shishinden) was struck repeatedly by lightning, and the city experienced weeks of rainstorms and floods. Attributing this to the angry spirit of the exiled Sugawara, the imperial court built a Shinto shrine called Kitano Tenman-gū in Kyoto, and dedicated it to him. They posthumously restored his title and office, and struck from the record any mention of his exile. Even this was not enough, and 70 years later Sugawara was deified as Tenjin-sama, a god of sky and storms. Eventually Tenjin evolved into a benign kami of scholarship. Today many Shinto shrines in Japan are dedicated to him. He became the most notable example of an interesting spiritual transformation: a vengeful Japanese spirit, onryō, is a violent ghost, usually a former aristocrat who was wrongfully killed, and consequently seeking revenge. When well supplicated, however, onryō spirits may willingly convert to goryō, benevolent spirits who can be powerful allies.
That's a lot of coincidence.