The demon queller (Chinese: Zhong Kui, Japanese: Shōki) straddled the porous divide between the world of ghosts and the world of the living in early modern China and Japan. He started out as a ghostly apparition protecting Tang Dynasty Emperor Xuanzong (r. 713-56) in his dream. Despite being a ghost, he shared in the experience of human struggles. In life, he had been so distraught by his ugliness and failure at the civil service examination that he committed suicide. In the popular imagination, he combined human traits with apotropaic powers, protecting homes, travellers, and the young against demons and disease. He used his fearsome looks to keep danger away while his insight into human frailties allowed him to be a more effective protector.