Zhong Kui

Zhong Kui () is a deity in Chinese and Japanese mythology (where his name is pronounced Shōki). Traditionally regarded as a vanquisher of ghosts and evil beings and reputedly able to command 80,000 demons, his image is often painted on household gates as a guardian spirit as well as in places of business where high-value goods are involved.
Becoming the king of ghosts.
According to folklore, Zhong Kui travelled with a friend from his hometown, Du Ping (杜平), to take part in the state-wide imperial examinations held in the capital city. Though Zhong Kui attained great academic success through his achievement of top honors in the major exams, his rightful title of "Zhuangyuan" (top-scorer) was stripped from him by the emperor because of his disfigured and ugly appearance. In anger and fury, Zhong Kui committed suicide by continually hurling himself against the palace gates until his head was broken, whereupon Du Ping had him buried and laid to rest. During the divine judgment after his death from suicide, Yama (the Chinese Hell King) saw much potential in Zhong Kui, intelligent and smart enough to score top honors in the imperial examinations but condemned to Hell because of the grave sin of suicide. Yama then gave him a title as the king of ghosts and tasked him to hunt, capture, take charge of and maintain discipline and order among all ghosts. After Zhong Kui became the king of ghosts in Hell, he returned to his hometown on Chinese New Year's eve. To repay Du Ping's kindness, Zhong Kui gave his younger sister in marriage to Du Ping.
Popularization in later dynasties.
Zhong Kui's popularity in folklore can be traced to the reign of Emperor Xuanzong of Tang China (712 to 756). According to Song Dynasty sources, once the Emperor Xuanzong was gravely ill and had a dream in which he saw two ghosts. The smaller of the ghosts stole a purse from imperial consort Yang Guifei and a flute belonging to the emperor. The larger ghost, wearing the hat of an official, captured the smaller ghost, tore out his eye and ate it. He then introduced himself as Zhong Kui. He said that he had sworn to rid the empire of evil. When the emperor awoke, he had recovered from his illness. So he commissioned the court painter Wu Daozi to produce an image of Zhong Kui to show to the officials. This was highly influential to later representations of Zhong Kui.
Legacy.
Zhong Kui and his legend became a popular theme in later Chinese painting, art, and folklore. Pictures of Zhong Kui used to be frequently hung up in households to scare away ghosts. His character was and still is especially popular in New Year pictures.