In East Asian and Buddhist mythology, Yama (sometimes known as the King of Hell, King Yan or Yanluo) is a dharmapala (wrathful god) said to judge the dead and preside over the Narakas ("Hells" or "Purgatories") and the cycle of saṃsāra.
Although based on the god Yama of the Hindu Vedas, the Buddhist Yama has developed different myths and different functions from the Hindu deity. He has also spread far more widely and is known in every country where Buddhism is practiced, including China, Korea, Japan, Vietnam, Bhutan, Mongolia, Thailand, Sri Lanka, Cambodia, Myanmar and Laos.
Adopted from Hinduism into Buddhism, Yama's exact role is fairly vague in canonical texts, but is clearer in extracanonical texts and popular beliefs, although these are not always consistent with Buddhist philosophy.
In the Pali canon, the Buddha states that a person who has ill-treated their parents, ascetics, holy persons, or elders is taken upon his death to Yama. Yama then asks the ignoble person if he ever considered his own ill conduct in light of birth, deterioration, sickness, worldly retribution and death (Māra). In response to Yama's questions, such an ignoble person repeatedly answers that he failed to consider the kammic consequences of his reprehensible actions and as a result is sent to a brutal hell "so long as that evil action has not exhausted its result."