Built in the Bayon style under Jayavarman VII, the temple's name was derived from the statue found depicting the Hindu god Yama (閻摩), the god of death. The statue was called the "Leper King" because discolouration and moss growing on it reminiscent a person with leprosy.